The objective is to redirect a user after he/she saves a form, to a success page. The question is what’s the best redirect method – redirect code – that should be used?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Technically, I think 303 is most appropriate, assuming that you always want the redirect to be executed as a GET, per the spec.
However, that won’t be supported by HTTP 1.0 clients. All modern browsers should be good with HTTP 1.1 though.
302 redirects will work fine, but if browsers ever decide to implement the spec correctly (which is unlikely at this point), this may break apps because technically, it’s supposed to use the same method as the original request (so if you post, it will post for the redirect as well). In fact, most web frameworks’ built-in redirect functionality uses 302 redirects, not 303’s, but that’s just because the browsers have created a de facto standard.