Get the result from another URL with GET.
When to use it
Redirect after a form POST so a refresh doesn’t resubmit it.
Good to know
303 is the correct code for Post/Redirect/Get: after a form POST, redirect to a result page with 303 so the browser loads it with GET, and a refresh or the back button doesn’t resubmit the form. Unlike 302, the switch to GET is guaranteed by the spec for any original method, including PUT and DELETE, and the request body is dropped.
Search engines treat 303 like a temporary redirect, but it rarely appears on crawlable URLs. It isn’t cached unless headers say so. In APIs, 303 can send a client from a finished async job to its result. fetch follows it automatically in the default redirect mode; response.redirected tells you a redirect happened, and response.url gives the final address after the GET.
Redirection (3xx)
3xx codes are redirections: the client has to go somewhere else, or use its cached copy, to finish the request.
What it looks like
HTTP/1.1 303 See OtherHow to send it
| Node.js / Express | res.redirect(303, '/new-url') |
|---|---|
| Python / Flask | return redirect('/new-url', code=303) |
| nginx | return 303 https://example.com$request_uri; |
How to check it
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/