[Catalyst] Redirect status codes (was: HTTP redirect - delayed Firefox)

A. Pagaltzis pagaltzis at gmx.de
Sat Feb 10 08:30:05 GMT 2007


* John Napiorkowski <jjn1056 at yahoo.com> [2007-02-08 22:55]:
> I believe that when redirecting as a result of a post that 303
> is supposed to be correct, whereas 302 is used for redirects
> when the information is merely at a different location. But I'm
> not an expert. So 303 is probably what most of us use redirect
> for, like when you click on save in a form and then you want to
> redirect the user back to a different page.

Actually, 302 means “repeat the same request at this other URI”
whereas 303 means “please retrieve this other URI using GET.” The
difference is that strictly according to RFC, 302 means the
request should be repeated with the same method, so if you return
a 302 to the browser in response to a POST, the browser would
have to repeat the full POST at the redirect target address.

So for POST-redirect-GET, 303 is the correct redirect status.
Note though that 303 was introduced in HTTP 1.1; if the client
sent you a HTTP 1.0 request, you have no other choice than 302.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list