Redirection · 3xx

302 Found

The resource is temporarily at a different URL. Use the new URL for this request only.

What 302 Found means

302 Found is a temporary redirect. The original URL is still the canonical one; the client should not update bookmarks, and search engines should not transfer ranking. 302 is commonly used for login redirects (after auth, redirect to the originally-requested page), A/B testing (redirect 50% of traffic to a variant), and feature flags. The historic ambiguity around method changes (some clients changed POST to GET, some did not) led to the introduction of 303 and 307 with explicit semantics.

When servers should return it: Return 302 for temporary redirects where the original URL stays canonical. For redirects after a POST that should become a GET, use 303 instead. For temporary redirects that must preserve the method, use 307.

Example response

curl -i https://example.com/admin

HTTP/2 302
location: /login?return=/admin

Related status codes

Frequently Asked Questions

Why does 302 sometimes change POST to GET?
Historical browsers did this. The HTTP spec was ambiguous, so RFC introduced 303 (always GET) and 307 (preserve method) to disambiguate. Modern clients tend to preserve the method on 302, but you cannot rely on it.
Should I use 302 or 307?
For new APIs, 307. For browser-facing redirects where you do not care about method preservation, 302 still works.
Defined in: RFC 9110 · Class: 3xx Redirection

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.