HTTP Status Codes

307 Temporary Redirect

A temporary redirect that guarantees the method and body are preserved — the unambiguous, method-safe alternative to 302.

What it means

307 Temporary Redirect behaves like 302 but explicitly forbids changing the request method. A POST that hits a 307 is re-sent as a POST to the new URL with the original body intact. Use it when a temporary redirect must keep a non-GET method.

HTTP RESPONSE
HTTP/1.1 307 Temporary Redirect
Location: https://api.example.com/v2/orders

HSTS preload

Browsers internally use a 307 when upgrading a request to HTTPS because of HSTS — you may see it in dev tools even without a server redirect.

Why it matters

  • It removes the 302 ambiguity, guaranteeing the method survives a temporary redirect.
  • It is the correct temporary redirect for APIs handling POST/PUT/PATCH.

Common mistakes

  • Using 307 for a permanent move — use 308 instead so signals consolidate.
  • Expecting the body to be dropped as with some 302 clients; 307 keeps it.

How WebInspect checks this

  • WebInspect shows the method preserved across each redirect hop and flags HSTS-driven upgrades.