In this Article
HTTP 307 Temporary Redirect sends a request to another URL while preserving its method and body when followed automatically. HTTP 307 is not inherently an error: first distinguish a server response from Chrome’s internal HTTPS upgrade, then inspect the Location header and redirect chain. Correct unexpected routing or loops at the responsible layer; leave intentional redirects alone. MDN explains 307 semantics; Chromium documents synthetic upgrades.
Start with the original URL, method and timestamp to correlate browser evidence with edge and application logs.
What does HTTP 307 mean?
HTTP 307 identifies a temporary destination in Location. Following is optional; future requests should still use the original URL. RFC 9110 defines these rules.
A redirected GET remains GET; a POST retains its method and body. MDN documents method preservation. For broader context, see our status-code hub.
HTTP 307 has the same meaning in HTTP/1.1 and HTTP/2. HTTP/2 carries the code in the :status pseudo-header rather than an HTTP/1.1 status line. RFC 9113 defines the response pseudo-header.
How do you inspect a real HTTP 307 response?
Inspect the first response before following it, then compare the destination method and body. This local example uses the Python HTTP server interfaces.
Start the server in one terminal:
python3 - <<'PY'
from http.server import BaseHTTPRequestHandler, HTTPServer
class Handler(BaseHTTPRequestHandler):
protocol_version = "HTTP/1.1"
def do_POST(self):
body = self.rfile.read(int(self.headers.get("Content-Length", "0")))
print(self.command, self.path, repr(body), flush=True)
redirect = self.path == "/start"
result = b"" if redirect else b"POST " + body + b"\n"
self.send_response(307 if redirect else 200)
if redirect:
self.send_header("Location", "/finish")
self.send_header("Content-Length", str(len(result)))
self.end_headers()
self.wfile.write(result)
HTTPServer(("127.0.0.1", 8000), Handler).serve_forever()
PY
In another terminal, inspect the initial response:
curl --noproxy '*' -i --data 'item=book' http://127.0.0.1:8000/start
Initial response excerpt:
HTTP/1.1 307 Temporary Redirect
Location: /finish
Content-Length: 0
The status line identifies the redirect. Location: /finish resolves to http://127.0.0.1:8000/finish; Content-Length: 0 describes the redirect response body, not the submitted POST body.
Follow the redirect with a limit of three hops:
curl --noproxy '*' -i -L --max-redirs 3 --data 'item=book' http://127.0.0.1:8000/start
With -i -L, curl displays both responses. The 307 is followed by this final status line:
HTTP/1.1 200 OK
Final response body:
POST item=book
The server logs confirm that both paths received POST with b'item=book':
POST /start b'item=book'
POST /finish b'item=book'
Tested on November 18, 2026 with Python 3.12.3 and curl 8.5.0 against the local fixture above.
See curl redirect handling, the option reference for -i and --max-redirs, and our curl headers guide.
Which layer produced the HTTP 307 redirect?
Identify the layer before changing configuration. Corroborate header clues with matching request logs.
| Symptom | Check | Meaning | Fix/action |
|---|---|---|---|
| Browser-only internal 307 | DevTools reason; compare curl and logs |
Possible browser HTTPS upgrade | Investigate HTTPS destination failure |
/items becomes /items/ |
Registered route and Location |
Possible framework normalization | Request canonical route |
| Repeated scheme/host hops | Chain; edge/origin rules | Conflicting routing | Correct rules or forwarded-header trust |
307 responding to CONNECT |
Verbose proxy handshake | Tunnel not established | Check endpoint and policy |
POST reaches unexpected handler |
Destination method/body logs | Wrong destination route | Correct route or redirect semantics |

Chrome: 307 Internal Redirect and HSTS
In DevTools, select the 307 Internal Redirect entry and inspect Non-Authoritative-Reason in its headers. HSTS identifies an HSTS upgrade; HttpsUpgrades identifies Chrome’s HTTPS-upgrade mechanism. These synthetic redirects originate inside the browser, so origin logs need not contain a corresponding HTTP 307 response. Chromium documents the diagnostic header.
Compare the URL with curl and inspect the HTTPS destination. Fix destination connectivity or certificates instead of disabling HSTS. RFC 6797 specifies the upgrade.
FastAPI: trailing slashes and proxy-generated URLs
FastAPI defaults to redirect_slashes=True; a registered /items/ can redirect /items with 307. Match the registered path. FastAPI documents slash handling.
Behind a proxy, check whether Location has the public scheme and host. Configure --forwarded-allow-ips for known infrastructure; avoid trusting arbitrary incoming forwarded headers. FastAPI explains proxy-aware redirects.
curl and Git: 307 from proxy after CONNECT
For received HTTP code 307 from proxy after CONNECT, investigate the handshake. CONNECT needs a successful 2xx response; 307 means no tunnel exists yet. In the verbose trace, locate the outgoing CONNECT host:443 request and its response. A 307 there is a tunnel-handshake failure. A 307 after a successful tunnel and subsequent HTTPS request belongs to a different stage; investigate that request’s redirect chain. RFC 9110 defines tunnel establishment.
For Git over HTTP(S), inspect http.proxy, remote.<name>.proxy, and environment variables such as http_proxy, https_proxy and all_proxy. Git documents proxy configuration.
Enable GIT_TRACE_CURL=1 with GIT_TRACE_CURL_NO_DATA=1 to inspect the failure. The second variable suppresses data dumps; redact sensitive headers and URLs before sharing. Git documents tracing.
curl error 56 means a receive failure, not necessarily this handshake problem. libcurl defines CURLE_RECV_ERROR. Check the proxy endpoint, scheme, port and policy using curl verbose diagnostics. IP rotation cannot repair HSTS or routing loops. For proxy authentication challenges, use the 407 guide.
What should each reader do?
Report the first unexpected hop, not just the final error.
| Reader | Action |
|---|---|
| Visitor | Report loops with the original URL and time. |
| Developer | Compare destination method/body logs with the intended route. |
| Server owner | Correlate edge and origin logs; locate the rule creating Location. |
| Scraper/API client | Check redirect policy, destination allowlist and proxy handshake. |
For wget, urllib or yum wrapper messages, inspect the actual response. Preserve redirect policy when translating requests with the curl-to-Python workflow.
How does HTTP 307 compare with 302, 308, 301 and 303?
| Code | Meaning when followed |
|---|---|
| 307 | Temporary; preserve method and body. |
| 302 | Temporary; POST-to-GET is permitted. |
| 308 | Permanent; preserve method and body. |
| 301 | Permanent; POST-to-GET is permitted. |
| 303 | Retrieve another resource with GET or HEAD. |
Should you follow, retry or leave HTTP 307 alone?
Follow intentional redirects to approved destinations. Bound hops, verify the final handler and review cross-origin credential forwarding. Avoid blind POST retries that risk duplicate actions. See HTTP retry rules and our Python retry guide.
Temporary does not mean never cached: inspect Cache-Control and applicable storage rules. Handle 429 Too Many Requests and rate limiting separately.
Googlebot follows HTTP 307 redirects, but Google does not use a temporary redirect itself as a signal that its target should be canonical. Other canonicalization signals can still lead to target indexing. This does not establish a blanket rule that 307 transfers zero link equity. Google Search Central explains temporary redirects.
Frequently Asked Questions
Is HTTP 307 an error?
It is a redirection status. Investigate unexpected destinations or request handling. RFC 9110.
Does 307 preserve POST data?
Automatic following preserves the method and body. Confirm reception at the destination. MDN.
How do I fix an unexpected 307?
Inspect Location, identify the first incorrect hop and correct its route or rule. RFC 9110.
Does an internal 307 always mean HSTS?
No. Inspect Non-Authoritative-Reason to distinguish HSTS from HttpsUpgrades. Chromium.
Will following redirects fix a CONNECT failure?
Check the proxy handshake separately: a non-2xx CONNECT response leaves the tunnel unestablished. RFC 9110.
Can I replace 307 with 308?
Only when the destination change should be permanent. RFC 9110 defines 308.
Make the next redirect trace actionable
Share the original URL, method, Location chain and final result with the responsible owner. Redact sensitive details.
Last updated: November 18, 2026.

State/City/Zip/ASN Targeting 



