Does the HTTP protocol allow a 302 request header to be modified so some parameters can be set and passed to the url receiving the request?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
302 is a response code, not a request header. The client will resolve the redirect by doing a new request for the new URL, so your client may add whatever headers it want to that new request.
A server wanting some data be sent along to the new URL should do so by appending it to the URL as querystring variables, for example: http://example.com/new-url?variable=data
.
If the redirect is happening within your own domain you may also set a cookie which the client may send to the new address. Cookies will only be sent inside the same domain, not if you are redirecting to somewhere else.