Skip to content
HTTP 307 Temporary Redirect — What It Means & How to Debug

HTTP 307 Temporary Redirect — What It Means & How to Debug

DodaTech Updated Jun 20, 2026 4 min read

HTTP 307 Temporary Redirect preserves the HTTP method and body when redirecting — unlike 302, it guarantees POST/PUT requests are resent with the same method.

What It Means

The HTTP 307 Temporary Redirect status code instructs the client to repeat the request at a different URL, but with one critical rule: the HTTP method and request body must remain unchanged. This is the key difference from 302 Found, which historically allowed browsers to change POST to GET.

When a server returns 307, it includes a Location header with the new URL. The client must resend the exact same request — including headers, method, and body — to the new URL. The redirect is temporary, meaning clients and search engines should continue using the original URL for future requests.

This status code was introduced in HTTP/1.1 to fix the ambiguity of 302. While most modern browsers respect method preservation for 302, the RFC explicitly guarantees it for 307. It is the safe choice when you need to redirect a non-GET request without losing the request payload.

When It’s Sent

  • POST form submissions — a form is submitted to a temporary URL that redirects to the processing endpoint
  • API load shedding — temporarily redirecting POST/PUT requests to a different server during maintenance
  • Authentication redirects — redirecting a POST with credentials to an auth endpoint while preserving the body
  • Temporary URL restructuring — moving endpoints during a migration without committing to the change
  • Maintenance mode — redirecting write operations to a read-only or fallback endpoint temporarily

Real Example

curl -v -X POST \
  -H "Content-Type: application/json" \
  -d '{"title":"New Post","body":"Hello"}' \
  -L https://api.example.com/submit

Expected response:

> POST /submit HTTP/1.1
> Host: api.example.com
> Content-Type: application/json
> Content-Length: 38
>
< HTTP/1.1 307 Temporary Redirect
< Location: https://api.example.com/submit-v2
< Content-Length: 0
<
* Issue another request to this URL:
* POST https://api.example.com/submit-v2
> POST /submit-v2 HTTP/1.1
> Host: api.example.com
> Content-Type: application/json
> Content-Length: 38
>
< HTTP/1.1 201 Created
< Content-Type: application/json
< Content-Length: 36
<
{"status":"created","id":"post-456"}

Note that curl’s -L flag follows redirects and correctly resends the POST body for 307, confirming method preservation.

How to Debug

Browser DevTools

  1. Open Network tab and check Preserve log (redirects may clear the log otherwise)
  2. Trigger the request that causes the redirect
  3. Look for the request with status 307
  4. Check the Headers tab for the Location field
  5. A second request appears — verify its method is POST (not GET)
  6. Confirm the request body is present in the second request

curl

# Show the redirect without following it
curl -v -X POST -d '{"key":"value"}' \
  https://example.com/submit

# Follow the redirect and see if method+body are preserved
curl -v -L -X POST -d '{"key":"value"}' \
  https://example.com/submit

The -L flag is essential — without it, curl shows only the redirect response. With -L, it follows the redirect and shows the final response.

Postman

Disable Automatically follow redirects in Settings to see the 307 response, including the Location header. Re-enable it to see the final response. Verify in the Headers tab of the redirected request that POST method and body are preserved.

Common Causes

ScenarioWhat HappensWhy It Matters
Form submission redirectPOST redirects to processing endpointForm data is preserved through the redirect
API version migrationOld endpoint temporarily redirects to new oneClients can migrate at their own pace
Load balancingWrite operations redirected to primary serverEnsures consistency during failover
Maintenance windowAll mutating requests redirected to status pagePrevents data loss during maintenance
Authentication handoffPOST with credentials redirected to auth serviceCredentials are preserved in the redirect

FAQ

What is the difference between 307 and 302?
Both are temporary redirects, but 307 guarantees the HTTP method and body are preserved, while 302 historically allowed (and many browsers still practice) changing POST to GET. For API clients that send non-GET requests, 307 is the unambiguous choice. For regular web pages with GET requests, there is no practical difference.
Does 307 work with all HTTP methods?
Yes. 307 works with GET, POST, PUT, PATCH, DELETE, and any other HTTP method. The client must resend the identical request — same method, same headers, same body — to the redirected URL. This makes 307 the safest redirect for REST APIs where method semantics matter.
Will search engines follow a 307 redirect?
Search engines treat 307 as a temporary redirect and keep the original URL indexed. Unlike 301, no link equity (PageRank) is transferred to the target URL. Use 307 for truly temporary situations and 308 (or 301 for GET requests) when the redirect is permanent.

Related Codes

  • HTTP 301 Moved Permanently — permanent redirect, may change POST to GET
  • HTTP 302 Found — temporary redirect, may change POST to GET
  • HTTP 308 Permanent Redirect — permanent redirect, preserves method
  • HTTP 303 See Other — forces GET after POST for form results

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro