devkult_
tools29converters34

307 Temporary Redirect

3xx redirection

A temporary redirect where the client must repeat the exact same request — method and body — at the new URL.

307 is a 302 without the ambiguity: the client must resend the same method and body to the Location URL, so a POST stays a POST. That makes it the safe temporary redirect for APIs and form endpoints.

Browsers also show an internal 307 when HSTS upgrades an http:// URL to https:// before the request ever leaves the machine.

Class3xx Redirection
Retry?Not applicable
Cacheable by defaultNo — only with explicit Cache-Control
Response bodyAllowed
Defined inRFC 9110 §15.4.8 — 307 Temporary Redirect
Example response
HTTP/1.1 307 Temporary Redirect
Location: https://api.example.com/v2/orders

When you'll see it

  • Temporary moves of API endpoints.
  • HSTS upgrades, which Chrome DevTools labels '307 Internal Redirect'.
  • Next.js redirect() and non-permanent redirects in next.config respond with 307.

How to use it well

  1. Use 307 instead of 302 whenever the method must be preserved.
  2. For a permanent move with the same guarantee, use 308.
  3. A '307 Internal Redirect' in DevTools is HSTS, not your server — there's nothing to fix.

Useful here: 301 vs 302 vs 307 vs 308

Send a 307 from your server

Express
res.redirect(307, "https://api.example.com/v2/orders");
Next.js route handler
return NextResponse.redirect(new URL("https://api.example.com/v2/orders", request.url), 307);
Flask
return redirect("https://api.example.com/v2/orders", code=307)
Go net/http
http.Redirect(w, r, "https://api.example.com/v2/orders", http.StatusTemporaryRedirect)
nginx
return 307 https://api.example.com/v2/orders;

Check what a URL returns

Print just the status line from the command line, or check a whole list of URLs at once, with their response headers, in the HTTP Status Checker.

curl -sI https://example.com/your-path | head -n 1

Frequently asked questions

What does '307 Internal Redirect' mean in Chrome?

The site sent a Strict-Transport-Security header earlier, or is on the HSTS preload list, so Chrome rewrote http:// to https:// locally. No request reached the server.

307 vs 302?

Same meaning — temporary — but 307 forbids changing the method. With a 302, browsers turn a POST into a GET.

Headers used with 307
Related status codes