HTTP 307 — Temporary Redirect
HTTP 307
Temporary Redirect
Like 302, but the client must repeat the request with the same method and body.
What 307 actually means
This is 302 with the historical ambiguity removed. Where browsers turn a redirected POST into a GET after a 302, a 307 guarantees the method and body survive: a POST stays a POST. That makes it the right code when you are temporarily routing an API endpoint elsewhere and cannot afford the request to quietly change shape on the way.
Common causes
- Temporarily routing traffic to a different host during a migration
- HSTS preload forcing an HTTP request to HTTPS before it leaves the browser (browsers report this internally as a 307)
- An API relocating an endpoint without wanting POST bodies dropped
If you're just trying to view the page
- Nothing — the browser handles this automatically
- A 307 shown for an HTTPS upgrade in developer tools is generated by your own browser, not by the site
If it's your site
- Use 307 rather than 302 whenever the request has a body you need preserved
- If the move is permanent, 308 is the method-preserving equivalent of 301
- Not cached by default, which is normally what "temporary" should mean
Reference
- Status code
- 307
- Reason phrase
- Temporary Redirect
- Category
- 3xx — Redirection
- Cacheable by default
- No
- Defined in
- RFC 9110 §15.4.8
Common questions
- What does HTTP 307 mean?
- Like 302, but the client must repeat the request with the same method and body. This is 302 with the historical ambiguity removed. Where browsers turn a redirected POST into a GET after a 302, a 307 guarantees the method and body survive: a POST stays a POST.
- How do I fix a 307 error?
- Nothing — the browser handles this automatically
- Is 307 a client error or a server error?
- 307 is in the 3xx range, which means redirection. It is not an error at all.
Related pages
- 301 Moved Permanently The URL has permanently moved and clients should use the new one from now on.
- 302 Found The resource is temporarily at a different URL; keep using the original one.
- 304 Not Modified Your cached copy is still current, so the server is not sending the file again.
- 308 Permanent Redirect Like 301, but the client must repeat the request with the same method and body.
- 303 See Other The request succeeded; now go and GET a different URL to see the result.
- 300 Multiple Choices The requested URL has several representations and the server is not choosing bet
- 305 Use Proxy A deprecated code telling the client to repeat the request through a specific pr
- 306 (Unused) A reserved code that was used in an old draft and is now permanently unassigned.