307 Temporary Redirect
Same as 302 but with a guarantee: the client must repeat the request with the original method and body, so a POST stays a POST.
At a glance
- Status code
- 307 Temporary Redirect
- Class
- 3xx, redirection, further action is needed to complete the request
- Defined in
- RFC 9110
- Cacheable by default
- by explicit headers only
- Response body
- Optional.
In detail
307 exists because 302 lost its meaning. Clients rewrite POST to GET on 302 for historical compatibility, so a code was needed that promises not to.
Use it whenever a temporary redirect must preserve the method: API endpoints, form submissions, anything with a body worth keeping.
If a POST arrives at the redirect target as a GET with no body, the redirect was 302 or 303 rather than 307.
Examples
HTTP/1.1 307 Temporary Redirect
Location: https://api2.example.com/v1/ordersThings that catch people out
- The body is resent, so the target must be prepared for a duplicate if the client retries.
- HSTS upgrades and other browser-internal redirects appear as 307 in developer tools without any server involvement, which makes them easy to misattribute.
Try it: HTTP Request Builder
Build a request with any method, headers and body, send it, and read the status line the server returns.
HTTP Request Builder
LOCAL · Browser-OnlyBuild and test HTTP requests with custom headers and body
Authentication
Headers
Generate Code
curl -X GET 'https://api.example.com/endpoint' \
-H 'Content-Type: application/json'Showing a sample URL. Enter your endpoint above to update the snippet.
Related HTTP status codes
All http status codes →302 Found
The resource is temporarily at a different URL. The original URL stays authoritative and should keep being used for future requests.
308 Permanent Redirect
A permanent redirect that preserves the request method and body. This is 301 without the historical POST to GET rewrite.
303 See Other
The result of the request is at another URL, and the client should fetch it with GET regardless of the original method.
400 Bad Request
The server refused the request because it was malformed. The client must change something before retrying, because repeating the same bytes will fail.
401 Unauthorized
The request lacks valid credentials. Despite the name, this is about authentication (who you are), not authorisation (what you may do).
402 Payment Required
Reserved for future use in the original specification, and now used in practice by APIs to signal that a plan limit or unpaid invoice is blocking the request.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL