HTTP status codes are like messages between your browser and a website’s server. They help explain what’s happening behind the scenes, from successful connections to errors that need fixing.
HTTP Status Codes: A Comprehensive Guide
1xx: Informational Responses
These status codes indicate a provisional response, requiring the requester to continue the action.
100 Continue
The server received the request headers and the client should proceed to send the request body.
101 Switching Protocols
The server agrees to switch protocols as requested by the client (e.g., upgrading from HTTP to WebSocket).
102 Processing
The server received and is processing the request but has no response yet (prevents client timeout).
103 Early Hints
Used to allow the client to preload resources while the server prepares a response.
2xx: Successful Responses
These status codes indicate that the client’s request was successfully received, understood, and accepted.
200 OK
Standard success response. The request has succeeded and the response contains the requested data.
201 Created
The request succeeded and a new resource was created (typically used with POST or PUT).
202 Accepted
Request accepted for processing but not yet completed (asynchronous operations).
204 No Content
The request succeeded but there’s no content to send back (common for DELETE operations).
206 Partial Content
A server delivers only part of the resource due to the client’s range header.
3xx: Redirection Messages
These status codes indicate that further action needs to be taken to complete the request.
300 Multiple Choices
Multiple options for the resource are available.
301 Moved Permanently
The resource has permanently moved to a new URL (search engines update their links).
302 Found (Previously “Moved Temporarily”)
Resource temporarily located at a different URL.
303 See Other
Response to the request can be found at another URL using the GET method.
304 Not Modified
The client can use cached data as the resource hasn’t changed since the last request.
307 Temporary Redirect
Similar to 302 but maintains the HTTP method used in the request.
308 Permanent Redirect
Similar to 301 but maintains the HTTP method used in the request.
4xx: Client Error Responses
These status codes indicate that the client seems to have made an error.
400 Bad Request
The server cannot process the request due to client error (malformed request syntax).
401 Unauthorized
Authentication is required and has failed or not been provided.
403 Forbidden
The client does not have access rights to the content (unlike 401, authentication won’t help).
404 Not Found
The server cannot find the requested resource.
405 Method Not Allowed
A request method is known but disabled and cannot be used.
408 Request Timeout
The server timed out waiting for the request.
429 Too Many Requests
The user has sent too many requests in a given time period (rate limiting).
5xx: Server Error Responses
These status codes indicate that the server failed to fulfill a valid request.
500 Internal Server Error
Generic error message when the server encounters an unexpected condition.
501 Not Implemented
The server does not recognize the request method or lacks ability to fulfill it.
502 Bad Gateway
The server acting as a gateway received an invalid response from an upstream server.
503 Service Unavailable
The server is temporarily unable to handle requests (overloaded or maintenance).
504 Gateway Timeout
The server acting as a gateway did not receive a timely response from an upstream server.
508 Loop Detected
The server detected an infinite loop while processing the request.
Hope this guide helps you understand HTTP status codes better and makes it easier to troubleshoot and improve your website.