tags:

views:

95

answers:

3

What's the difference between a 302 FOUND and a 307 TEMPORARY REDIRECT HTTP response?

The w3 spec seems to indicate that they're both used for temporary redirects, and neither can be cached unless the response specifically allows it.

Thanks!

A: 

Per the spec - no real major difference. They are practically interchangeable.

Yuval A
+3  A: 

The difference concerns redirecting POST, PUT and DELETE requests and what the expectations of the server are for the user agent behavior (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.

Also, read Wikipedia article on the 30x redirection codes.

Franci Penov
+1  A: 
Christopher