重定向 Web 服务 URL 对 Web 服务有影响吗?

发布于 2024-08-02 09:38:14 字数 584 浏览 6 评论 0原文

假设客户给了我这个 URL 来访问 GetQuotes 的 Web 服务:

http://www.somecompany.com/services/myservice.asmx

如果我尝试访问 Web 服务,我会被重定向到:

http://new.location.somecompany.com/theservice.asmx

这会影响调用此 Web 服务的 ASP.NET 客户端吗?

其中两个服务 URL 具有完全相同的 GetQuotes 方法。

[编辑] 出现这个问题的原因是因为我们正在尝试访问一个 Web 服务器,该服务器会根据负载不断将请求重新路由到不同的服务器。

Let's say a client gave me this URL to access a webservice to GetQuotes:

http://www.somecompany.com/services/myservice.asmx

If I tried to access the web service and I get redirected to:

http://new.location.somecompany.com/theservice.asmx

Will this affect the ASP.NET client calling this web service?

Where both service URLs have the exact same GetQuotes method.

[Edit]
The reason for this question is because we are trying to access a web server which keeps rerouting requests to different servers depending on the load.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌能量女王 2024-08-09 09:38:14

一般来说,重定向不会对您的客户端产生不利影响(只要它正确处理 HTTP 响应)。

但是,如果是 302 永久重定向,您可能只想更新链接并节省额外的 DNS 请求...

这也是公司为服务提供不变的外部链接同时仍能够移动的常见方法他们的后端。

In general a redirect shouldn't adversely affect your client (provided it handles HTTP responses correctly).

However if it's a 302 permanent redirect you might want to just update your link and save yourself the extra DNS request...

That can also be a common way for a company to provide an unchanging external link for a service while still being able to move their backend around.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文