Redirection · 3xx

307 Temporary Redirect

The resource is temporarily at a different URL. Use the same HTTP method to access it.

What 307 Temporary Redirect means

307 Temporary Redirect is a stricter version of 302. The key difference: 307 forbids the client from changing the request method on the redirect. If the original request was POST, the redirect target also gets POST. This is the right code for redirecting state-changing requests where you cannot afford method ambiguity, like API endpoints behind a load balancer doing failover.

When servers should return it: Return 307 for temporary redirects that must preserve the HTTP method. Common cases: API failover, regional routing, redirecting POST/PUT/PATCH/DELETE without losing the body.

Example response

curl -i -X POST -d "x=1" https://api.example.com/v1/users

HTTP/2 307
location: https://api-east.example.com/v1/users

Related status codes

Frequently Asked Questions

When should I use 307 instead of 302?
Whenever the request might be POST/PUT/PATCH and you cannot afford method ambiguity. For browser-facing GET redirects, 302 is still common.
307 vs 308?
307 is temporary, 308 is permanent. Both preserve the method. 308 is cached aggressively; 307 is not.
Defined in: RFC 9110 · Class: 3xx Redirection

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.