重定向 Web 服务 URL 对 Web 服务有影响吗?
假设客户给了我这个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,重定向不会对您的客户端产生不利影响(只要它正确处理 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.