HTTP status codes, explained for debugging
Not spec recitals — each page covers what the code tells you about where the failure lives, what actually causes it in production, and the concrete steps to fix it. Start from the code you're staring at.
1xx — Informational
Interim responses during request processing.
2xx — Success
The request succeeded; the variants say how.
- 200OKThe request succeeded and the response body carries the result.
- 201CreatedThe request created a resource.
- 202AcceptedThe request was accepted for processing, but processing has not completed — the async succ…
- 204No ContentSuccess with deliberately no response body — the correct answer for DELETE, many PUT/PATCH…
- 206Partial ContentThe server is returning only the byte range the client asked for (Range header), with the …
3xx — Redirection
The resource is elsewhere; follow Location.
- 301Moved PermanentlyThe resource lives permanently at the URL in the Location header, and clients should updat…
- 302FoundA temporary redirect: use the Location URL this time, but keep requesting the original URL…
- 304Not ModifiedThe client's cached copy is still valid — the server sends headers only, no body, in respo…
- 307Temporary RedirectLike 302, but strict: the client must repeat the request to the new URL with the same meth…
- 308Permanent RedirectThe permanent, method-preserving redirect: 301's semantics with 307's strictness.
4xx — Client errors
The request is at fault; fix and resend.
- 400Bad RequestThe server could not even process the request as sent — malformed JSON, invalid parameters…
- 401UnauthorizedMisnamed by history: it means unauthenticated.
- 403ForbiddenAuthentication succeeded — the server knows exactly who you are — and the answer is still …
- 404Not FoundThe server is reachable and speaks HTTP, but nothing lives at this URL.
- 405Method Not AllowedThe URL exists — but not for the HTTP method you used.
- 408Request TimeoutThe server gave up waiting for the client to finish sending its request — slow or stalled …
- 409ConflictThe request is well-formed but collides with current state: a duplicate unique key, a stal…
- 410GoneLike 404, but with a promise: the resource existed, was removed on purpose, and is never c…
- 413Content Too LargeThe request body exceeds a size limit somewhere in the chain.
- 415Unsupported Media TypeThe server refuses the request because of its Content-Type (or Content-Encoding) — the bod…
- 422Unprocessable EntityThe request parsed fine — syntax is valid — but the content fails semantic validation: a m…
- 429Too Many RequestsThe rate limiter speaking: this client has sent more requests than allowed in the current …
- 431Request Header Fields Too LargeThe request line or headers exceed the server's size limits — in practice, almost always r…
- 451Unavailable For Legal ReasonsThe content exists but cannot be served for legal reasons — censorship orders, GDPR geo-bl…
5xx — Server errors
The server failed; retrying may help.
- 500Internal Server ErrorThe application code threw and nothing caught it: an unhandled exception, a null dereferen…
- 501Not ImplementedThe server does not support the functionality required to fulfill the request — classicall…
- 502Bad GatewayA proxy or load balancer forwarded your request upstream and got garbage or nothing back: …
- 503Service UnavailableThe server is deliberately refusing work right now: overloaded, in maintenance mode, or (b…
- 504Gateway TimeoutThe proxy reached the upstream, the upstream accepted the request — and then took longer t…