What it means
Historically ambiguous - the spec says preserve the method, every browser changes POST to GET - which is exactly why 303 and 307 were introduced to say which you meant. For new code, use one of those.
- Class
- 3xx Redirection
- Defined in
- RFC 9110 §15.4.3
- Cached by default
- No
When you receive a 302
- Follow
Locationthis time, but keep requesting the original URL next time - the move is temporary. - Browsers turn a
POSTinto aGETwhen they follow a 302. If a form submission lost its body on the way, this is why.
When you send a 302
- In new code, say which one you mean:
303 See Othersends the client to aGETafter aPOST;307repeats the same method elsewhere. - Use 302 for a short-lived move where search engines should keep the original URL indexed.
- Not for a permanent move: the old URL may stay in search results. That is
301or308.
On the wire
HTTP/1.1 302 Found Location: /login?next=%2Fdashboard