π’ Definition β HTTP status codes are three-digit numbers issued by a server in response to a client's request, indicating the result of the request.
π Categories β These codes are divided into five classes: informational responses (1xx), successful responses (2xx), redirection messages (3xx), client error responses (4xx), and server error responses (5xx).
β Successful Codes β Codes in the 2xx range indicate successful requests, such as 200 OK, which means the request was successful and the server returned the requested resource.
π« Client Errors β Codes in the 4xx range indicate client errors, such as 404 Not Found, which means the server could not find the requested resource.
β οΈ Server Errors β Codes in the 5xx range indicate server errors, such as 500 Internal Server Error, which means the server encountered an unexpected condition that prevented it from fulfilling the request.
Informational Responses
βΉοΈ 100 Continue β This code indicates that the initial part of a request has been received and the client should continue with the request.
π 101 Switching Protocols β Sent in response to an Upgrade request header from the client, indicating the server is switching protocols.
β³ 102 Processing β Used in WebDAV to indicate that the server has received and is processing the request, but no response is available yet.
π 103 Early Hints β Allows the client to start preloading resources while the server prepares a response.
Successful Responses
β 200 OK β The request was successful, and the server returned the requested resource.
π 201 Created β Indicates that a new resource has been created as a result of the request.
π 202 Accepted β The request has been accepted for processing, but the processing is not complete.
π 203 Non-Authoritative Information β The server is returning information from a third-party source.
π« 204 No Content β The server successfully processed the request, but is not returning any content.
Client and Server Errors
β 400 Bad Request β The server could not understand the request due to invalid syntax.
π 401 Unauthorized β Authentication is required and has failed or has not yet been provided.
π« 403 Forbidden β The server understood the request, but refuses to authorize it.
π 404 Not Found β The server cannot find the requested resource.
β οΈ 500 Internal Server Error β The server encountered an unexpected condition that prevented it from fulfilling the request.
π§ 502 Bad Gateway β The server was acting as a gateway or proxy and received an invalid response from the upstream server.
β³ 503 Service Unavailable β The server is not ready to handle the request, often due to maintenance or overload.
Understanding HTTP 5xx Status Codes
π 500 Internal Server Error β This code indicates a generic error message when the server encounters an unexpected condition that prevents it from fulfilling the request.
π« 501 Not Implemented β This status code means the server does not support the functionality required to fulfill the request, often indicating that the server does not recognize the request method.
π 502 Bad Gateway β This error occurs when a server acting as a gateway or proxy receives an invalid response from the upstream server it accessed in attempting to fulfill the request.
β 503 Service Unavailable β This code indicates that the server is currently unable to handle the request due to temporary overloading or maintenance of the server.
β³ 504 Gateway Timeout β This status code is returned when a server acting as a gateway or proxy does not receive a timely response from the upstream server.
π 505 HTTP Version Not Supported β This error indicates that the server does not support the HTTP protocol version that was used in the request.
π 506 Variant Also Negotiates β This status code indicates an internal server configuration error where the chosen variant is itself configured to engage in content negotiation.
π¦ 507 Insufficient Storage β This code is used when the server is unable to store the representation needed to complete the request.
π 508 Loop Detected β This status code indicates that the server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity".
π 511 Network Authentication Required β This code is used when the client needs to authenticate to gain network access.
Follow me on: LinkedIn | WhatsApp | Medium | Dev.to | Github
Top comments (0)