On this page

1xx — Informational

The request has been received and the server is continuing to process. Modern clients rarely need to handle 1xx responses directly; servers send them and frameworks deal with them transparently.

CodeNameMeaning
100ContinueThe initial part of the request has been received and not yet rejected. The client may proceed to send the body.
101Switching ProtocolsThe server is switching protocols as requested by the Upgrade header (e.g. to WebSockets).
102ProcessingWebDAV — the server has accepted the request but has not completed it yet.
103Early HintsHints to start preloading resources before the final response (typically used with Link headers).

2xx — Success

The request was successfully received, understood, and accepted. The most common HTTP status class in any healthy application.

CodeNameMeaning
200OKStandard success — the response body contains the requested resource.
201CreatedA new resource was created; the Location header points to it.
202AcceptedAccepted for processing but not yet acted on. Use for async jobs.
203Non-Authoritative InformationMetadata is a transformed version from an upstream — rare.
204No ContentSuccess; no body to return. Useful for DELETE and PUT.
205Reset ContentReset the document view that initiated the request.
206Partial ContentRange request fulfilled (resumable downloads, video streaming).
207Multi-StatusWebDAV — body contains an XML report of multiple results.

3xx — Redirection

Further action must be taken to fulfil the request. The Location header tells the client where to go next.

CodeNameMeaning
300Multiple ChoicesMultiple representations; client picks one.
301Moved PermanentlyResource moved permanently — update bookmarks and link targets.
302FoundTemporarily at a different URI. Method may be changed to GET (historical behavior).
303See OtherUse GET to retrieve the response at the Location URI.
304Not ModifiedCached resource still valid. No body returned.
307Temporary RedirectLike 302 but the method must be preserved.
308Permanent RedirectLike 301 but the method must be preserved.
i

301 vs 308. Both are permanent redirects. 301 historically allowed clients to change the method to GET; 308 requires preserving the original method. For modern APIs that need to redirect POST requests intact, use 308.

4xx — Client errors

The request contains bad syntax, is unauthorized, or cannot otherwise be fulfilled with this client and this request.

CodeNameMeaning
400Bad RequestMalformed syntax or invalid request framing.
401UnauthorizedAuthentication required (despite the name, not authorization).
402Payment RequiredReserved; used by some paywalls.
403ForbiddenThe server understood the request but refuses authorization.
404Not FoundNo resource at this URI; may be temporary or permanent.
405Method Not AllowedMethod known but not supported for this resource.
406Not AcceptableNo representation satisfies the Accept headers.
408Request TimeoutClient took too long to send the request.
409ConflictCurrent resource state conflicts with the request (e.g. edit conflicts).
410GoneResource intentionally removed; do not retry.
411Length RequiredContent-Length missing.
412Precondition FailedAn If-Match or similar precondition failed.
413Payload Too LargeBody exceeds server's accepted size.
414URI Too LongURI exceeds server limits.
415Unsupported Media TypeServer can't handle the request's media type.
418I'm a teapotRFC 2324 April Fools' joke. Used in real life by humorous error pages.
422Unprocessable ContentSyntactically valid request, semantically wrong (e.g. validation errors).
425Too EarlyServer unwilling to risk replay.
426Upgrade RequiredClient must use a newer protocol (e.g. TLS upgrade).
428Precondition RequiredServer requires conditional requests to prevent lost-update.
429Too Many RequestsRate-limited. Retry-After header tells client when to try again.
431Request Header Fields Too LargeHeaders exceed server limits.
451Unavailable For Legal ReasonsGeographic or legal restriction blocks the resource.
!

401 vs 403. 401 means "I don't know who you are — authenticate." 403 means "I know who you are, and you're not allowed." Both are about access, but they answer different questions.

5xx — Server errors

The server failed to fulfil an apparently valid request. The problem is on the server side.

CodeNameMeaning
500Internal Server ErrorGeneric catch-all. Check server logs.
501Not ImplementedServer doesn't support the requested method.
502Bad GatewayAn upstream server returned an invalid response.
503Service UnavailableServer overloaded or undergoing maintenance. Often comes with Retry-After.
504Gateway TimeoutAn upstream server didn't respond in time.
505HTTP Version Not SupportedServer doesn't support the HTTP version used.
507Insufficient StorageWebDAV — out of storage to perform the operation.
508Loop DetectedWebDAV — server detected an infinite loop.
511Network Authentication RequiredCaptive portal — client must authenticate to access the network.