DevKits
307

Temporary Redirect

3xx Redirection

Last updated:

Like 302 but explicitly preserves the request method (POST stays POST, etc.).

Description

Introduced to remove the ambiguity in 302. If a POST is redirected via 307, the client re-issues the POST at the new URL rather than converting to GET.

When to use

Use 307 for temporary redirects that must preserve HTTP method, such as maintenance redirects for a POST endpoint.

Specification

RFC 9110 §15.4.8

Examples

HTTP response
HTTP/1.1 307 Temporary Redirect
Content-Type: application/json

Location: /new-url
Node.js (Express)
res.status(307).redirect("/new-url");
Go (net/http)
w.WriteHeader(http.StatusTemporaryRedirect)
Python (Flask)
return jsonify({"error": "Temporary Redirect"}), 307

Related status codes

All 3xx codes