Skip to content
DDevToolery

HTTP status codes

The first digit carries the meaning: 1xx is informational, 2xx succeeded, 3xx needs another request, 4xx blames the request, 5xx blames the server. Picking the right one matters because clients, proxies and caches act on the class without reading your body.

28 entries

1xx — Informational

CodeNameMeaning
100ContinueThe headers are acceptable; send the body.
101Switching ProtocolsUpgrading, typically to WebSocket.
103Early HintsPreload hints while the real response is prepared.

2xx — Success

CodeNameMeaning
200OKStandard success with a body.
201CreatedA new resource exists. Include its Location header.
202AcceptedQueued for processing; the outcome is not yet known.
204No ContentSuccess with deliberately no body. Common for DELETE.
206Partial ContentA range request succeeded. Used by resumable downloads.

3xx — Redirection

CodeNameMeaning
301Moved PermanentlyPermanent. Caches and search engines will remember it — hard to undo.
302FoundTemporary, but may change the method to GET. Prefer 307.
303See OtherFetch the result elsewhere with GET. The POST-redirect-GET pattern.
304Not ModifiedThe cached copy is still valid. No body is sent.
307Temporary RedirectTemporary and preserves the method and body.
308Permanent RedirectPermanent and preserves the method and body.

4xx — Client error

CodeNameMeaning
400Bad RequestMalformed. The catch-all when nothing more specific fits.
401UnauthorizedNot authenticated — despite the name. Send WWW-Authenticate.
403ForbiddenAuthenticated but not allowed. Re-authenticating will not help.
404Not FoundNo such resource. Also used to hide the existence of one.
405Method Not AllowedWrong verb for this resource. Must include Allow.
409ConflictClashes with current state — a duplicate, or a failed optimistic lock.
410GoneDeliberately removed, permanently. Stronger than 404.
422Unprocessable ContentSyntax is fine, semantics are not. Validation failures.
429Too Many RequestsRate limited. Include Retry-After.

5xx — Server error

CodeNameMeaning
500Internal Server ErrorSomething broke and it was not the client's fault.
501Not ImplementedThe method is not supported at all.
502Bad GatewayAn upstream returned something invalid.
503Service UnavailableTemporarily down or overloaded. Include Retry-After.
504Gateway TimeoutAn upstream did not answer in time.

401 versus 403 is the pair most often swapped: 401 means we do not know who you are, 403 means we do and the answer is still no.