At One Place

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

  1. Nothing — the browser handles this automatically
  2. 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

  1. Use 307 rather than 302 whenever the request has a body you need preserved
  2. If the move is permanent, 308 is the method-preserving equivalent of 301
  3. 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

Sources

  1. Hypertext Transfer Protocol (HTTP) Status Code Registry — IANA
  2. RFC 9110: HTTP Semantics — IETF

How these figures are compiled and checked