307 307 Temporary Redirect
The resource is temporarily at a different URL — preserve the HTTP method.
What Is This?
The HTTP 307 Temporary Redirect status code is similar to 302 but guarantees that the HTTP method and body are preserved when following the redirect. If a POST request receives a 307, the client must resend the POST request to the new URL with the same body. This makes 307 safer than 302 for API endpoints where changing GET to POST (or vice versa) would cause errors.
Common Causes & Solutions
Common Cause
API endpoint temporarily relocated
Common Cause
Load balancer redirecting to a different backend server
Common Cause
Maintenance mode that preserves POST request semantics
Use 307 for API redirects
When temporarily moving API endpoints, use 307 to ensure POST/PUT/DELETE methods are preserved correctly.
// Express.js
app.post('/api/v1/orders', (req, res) => {
// Temporarily redirected to v2
res.redirect(307, '/api/v2/orders')
})Related Entries
More from this reference:
301 301 Moved Permanently
The requested resource has been permanently moved to a new URL.
302 302 Found (Temporary Redirect)
The requested resource is temporarily located at a different URL.
304 304 Not Modified
The resource has not been modified since the last request, use the cached version.
308 308 Permanent Redirect
The resource has been permanently moved — preserve the HTTP method.
Frequently Asked Questions
What is the difference between 307 and 308?
307 is temporary (like 302) while 308 is permanent (like 301). Both preserve the HTTP method. Use 307 for temporary moves and 308 for permanent moves when method preservation is critical.
Do browsers handle 307 correctly?
Modern browsers handle 307 correctly for GET and POST. However, some older browsers and HTTP clients may fall back to 302 behavior and change POST to GET. Test your target clients when using 307.