http – 302和307重定向之间有什么区别?

302 FOUND和307 TEMPORARY REDIRECT HTTP响应之间有什么区别?

The W3 spec似乎表明它们都用于临时重定向,并且两者都不能被缓存,除非响应明确允许它。

差异涉及重定向POST,PUT和DELETE请求,以及服务器对用户代理行为(RFC 2616)的期望:

Note: RFC 1945 and RFC 2068 specify that the client is not allowed to
change the method on the redirected
request. However, most existing user
agent implementations treat 302 as if
it were a 303 response, performing a
GET on the Location field-value
regardless of the original request
method. The status codes 303 and 307
have been added for servers that wish
to make unambiguously clear which kind
of reaction is expected of the
client.

另外,阅读关于30x redirection codes的维基百科文章。

http://stackoverflow.com/questions/2068418/whats-the-difference-between-a-302-and-a-307-redirect

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:http – 302和307重定向之间有什么区别?