HTTP Response Status Codes
HTTP response status codes indicate whether an HTTP request has been successfully completed. These codes are organized into five main categories:
- Informational responses (100–199)
- Successful responses (200–299)
- Redirections (300–399)
- Client errors (400–499)
- Server errors (500–599)
These codes are defined in the HTTP protocol specification, and the official documentation can be found in RFC 9110.
1. Informational Responses (100–199)
These codes indicate that the request has been received and is being processed.
- 100 Continue: The server has received the request and the client may continue sending data.
- 101 Switching Protocols: Indicates that the server accepts the requested protocol change.
- 102 Processing (WebDAV): The request is being processed, but no response is available yet.
- 103 Early Hints: Allows the client to start loading resources while the server prepares the response.
2. Successful Responses (200–299)
Indicates that the request has been successfully completed.
- 200 OK: The request was successful, and the response depends on the HTTP method used.
- 201 Created: The request has created a new resource.
- 202 Accepted: The request has been accepted, but it has not been processed yet.
- 204 No Content: The request was successful, but there is no content in the response.
- 206 Partial Content: A part of the requested content has been served, useful for interrupted downloads.
3. Redirections (300–399)
These codes indicate that the client must take additional actions to complete the request.
- 301 Moved Permanently: The resource has been permanently moved.
- 302 Found: The resource has been temporarily moved.
- 304 Not Modified: The resource has not changed since the last request, allowing the cached version to be used.
- 307 Temporary Redirect: Temporary redirection while maintaining the same HTTP method.
- 308 Permanent Redirect: Permanent redirection while maintaining the same HTTP method.
4. Client Errors (400–499)
These codes indicate that there was an error in the client's request.
- 400 Bad Request: The request has incorrect syntax.
- 401 Unauthorized: Authentication is required to access the resource.
- 403 Forbidden: The server rejects the request due to lack of permissions.
- 404 Not Found: The requested resource was not found.
- 405 Method Not Allowed: The HTTP method is not allowed for the requested resource.
- 418 I'm a teapot: A joke code from the Hyper Text Coffee Pot Control Protocol (HTCPCP).
- 429 Too Many Requests: Too many requests have been made in a short period.
5. Server Errors (500–599)
These codes indicate that there was a problem on the server while processing the request.
- 500 Internal Server Error: A generic server error.
- 501 Not Implemented: The server does not support the requested functionality.
- 502 Bad Gateway: The server received an invalid response from another server.
- 503 Service Unavailable: The server is temporarily unavailable.
- 504 Gateway Timeout: The server did not receive a timely response from another server.
- 508 Loop Detected: An infinite loop was detected while processing the request.
Conclusion
Understanding HTTP status codes is essential for diagnosing communication problems on the web and improving the user experience. Each code provides key information about the state of a request, allowing appropriate actions to be taken based on the situation.
For further details, it is recommended to review the official HTTP protocol documentation and the relevant RFCs.