DEV Community

Vipul Kumar
Vipul Kumar

Posted on • Originally published at knowledge-bytes.com

Understanding HTTP Status Codes

πŸ”’ 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.

Read On LinkedIn or WhatsApp

Follow me on: LinkedIn | WhatsApp | Medium | Dev.to | Github

Top comments (0)