HTTP 302 Found

Quick answer

HTTP 302 Found means the resource is temporarily at a different URL. The client should keep using the original URL for future requests.

What HTTP 302 means

302 Found is a temporary redirect. The resource lives at the original URL but should be fetched from the Location URL for now. Unlike 301, search engines do not transfer ranking and clients should not update their stored URL.

Common causes

Response body

Redirects usually have no JSON body — the Location header carries the temporary URL.

Raw HTTP response

HTTP/1.1 302 Found
Location: https://example.com/login
Content-Type: text/html

How to handle HTTP 302

302 vs 307 — the method-change gotcha

The historical wrinkle with 302 is method handling. The original HTTP spec said clients should repeat the request with the same method, but in practice browsers and libraries routinely turned a POST into a GET when following a 302. 307 Temporary Redirect was introduced to remove the ambiguity — it guarantees the method and body are preserved.

CodeDurationMethod on redirect
302 FoundTemporaryMay change POST→GET (client-dependent)
307 Temporary RedirectTemporaryAlways preserved
301 / 308Permanent301 may change; 308 preserved

So for a temporary redirect after a POST (for example, redirecting back after login), reach for 307 if the method must survive; use 302 for ordinary GET redirects.

Handling a 302 in client code

Browsers and most HTTP libraries follow 302s automatically. When you need to see the redirect instead of following it (e.g. to read the Location), disable auto-follow:

// fetch: inspect the redirect instead of following it
const res = await fetch('/dashboard', { redirect: 'manual' });
if (res.status === 302) {
  const target = res.headers.get('Location');
}

// curl: show headers without following
// curl -sI https://example.com/dashboard

Frequently Asked Questions

What is the difference between 301 and 302?

301 is a permanent move — update references and search engines transfer ranking. 302 is temporary — keep using the original URL and no ranking is transferred. Choose based on whether the move is permanent.

Does 302 change the HTTP method on redirect?

Historically many clients changed POST to GET on a 302. If you need to preserve the method, use 307 Temporary Redirect, which guarantees the method and body are kept.

Is 302 bad for SEO?

A 302 tells search engines the move is temporary, so ranking stays with the original URL. If the move is actually permanent, using 302 instead of 301 can prevent the new URL from gaining the ranking it should.

When should I use 307 instead of 302?

Use 307 Temporary Redirect when the redirect follows a non-GET request (like a POST) and the method and body must be preserved. 302 may downgrade a POST to a GET on some clients; 307 guarantees it won't.

How do I stop fetch or curl from following a 302 automatically?

In fetch, pass { redirect: 'manual' } to see the 302 and read its Location header instead of following it. With curl, omit -L (and use -I to print headers) so it shows the redirect rather than following it.

Working with a JSON API response?

Format and inspect any response in your browser — nothing is uploaded.

JSON Formatter JSON Validator All HTTP Status Codes
About the author

Pasindu Ishan is a software developer based in Sri Lanka. He builds privacy-first developer tools at JSON Dev Tools.