HTTP Status Codes

What are HTTP Status Codes? What purpose do they serve? Should I remember them all?

Status codes are issued by a server in response to a client’s request made to the server.

Status Code Categories

All HTTP response status codes are separated into five classes or categories. The first digit of the status code defines the class of response, while the last two digits do not have any classifying or categorization role.

1xx: Informational : Request received, continuing process
2xx: Success : The action was successfully received, understood, and accepted
3xx: Redirection : Further action must be taken in order to complete the request
4xx: Client Error : The request contains bad syntax or cannot be fulfilled
5xx: Server Error : The server failed to fulfill an apparently valid request

⋆ : Popular Status Codes

1xx: Informational Response

Request received, continuing process

Status CodeErrorDescription
100ContinueThis indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished. \n To have a server check the request’s headers, a client must send Expect: 100-continue as a header in its initial request and receive a 100 Continue status code in response before sending the body.
101Switching ProtocolsThe client has asked the server to switch protocols and the server has agreed to do so, via the Upgrade message header field in response, see Protocol Upgrade Mechanism
102Processing
103Early Hints

2xx: Successful Response

The action was successfully received, understood, and accepted

Status CodeErrorDescription
200OK
201Created
202Accepted
203Non-Authoritative Information
204No Content
205Reset Content
206Partial Content

3xx: Redirection Messages

Further action must be taken in order to complete the request

Status CodeErrorDescription
300Multiple Choices
301Moved Permanently
302Found
303See Other
304Not Modified
307Temporary Redirect
308Permanent Redirect

4xx: Client Error Response

The request contains bad syntax or cannot be fulfilled

Status CodeErrorDescription
400Bad Request
401Unauthorized
402Payment Required
403Forbidden
404Not Found
405Method Not Allowed
406Not Acceptable
407
408Request Timeout
409Conflict
410Gone
411Length Required
412Precondition FailedThe server does not meet one of the preconditions that the requester put on the request header fields.
413
414
415
416
417
418

5xx: Server Error Response

The server failed to fulfill an apparently valid request

Status CodeErrorDescription
500Internal Server Error
501Not Implemented
502Bad Gateway
503Service Unavailable
504Gateway Timeout
505HTTP Version Not Supported
506Variant Also Negotiates
510Not Extended
511Network Authentication Required