loot.tools
307

Temporary Redirect

3xx Redirection

The resource is temporarily elsewhere, and the method must not change.

307 Temporary Redirect is 302 with the loose ends tied up: the resource is temporarily at another URL, and the client must repeat the request there with the same method and body. Historically, clients turned a POST into a GET when following a 302, and 307 exists to forbid exactly that. Use it when redirecting API calls or form posts where the method matters.

What 307 looks like on the wire

POST /api/payments HTTP/1.1
Host: api.example.com

HTTP/1.1 307 Temporary Redirect
Location: https://api-failover.example.com/api/payments

About 3xx Redirection

Further action is needed to complete the request, usually following a redirect to another URL.

How to fix 307 Temporary Redirect

  • Use 307 instead of 302 when a POST or PUT must stay a POST or PUT after the redirect.
  • Keep the original URL canonical - 307 signals a temporary move.
  • Confirm your HTTP client re-sends the body on redirect. Some older libraries don't.

Where it's defined

307 Temporary Redirect is defined in RFC 9110 §15.4.8. MDN's 307 reference covers browser behavior and examples.

Looking for a different one? See the full HTTP status code reference.