This article provides a comprehensive guide to HTTP status codes.
Comprehensive Guide to HTTP Status Codes
HTTP (Hypertext Transfer Protocol) status codes are standardized responses from web servers indicating the outcome of a client’s request.
These codes are crucial for understanding how a web server processes requests and help in troubleshooting issues. They are categorized into five classes based on the first digit of the status code.
Informational Responses (1xx)
Informational responses indicate that the request was received and understood, and the server is continuing the process.
100 Continue
The server has received the initial part of the request and has not yet rejected it. The client should continue with the request or ignore if the request is already finished.
101 Switching Protocols
The server is switching protocols as requested by the client, usually in response to an Upgrade
header.
102 Processing (WebDAV)
The server has received and is processing the request, but no response is available yet. This prevents the client from timing out and assuming the request was lost.
SEE ALSO: WordPress Hosting Made Easy: How Rad Web Hosting Can Help You
Successful Responses (2xx)
Successful responses indicate that the client’s request was successfully received, understood, and accepted.
200 OK
The request was successful, and the server returned the requested resource or processed the data as expected.
201 Created
The request was successful, and a new resource was created as a result. This is typically used in response to POST requests.
202 Accepted
The request has been accepted for processing, but the processing has not been completed. It is typically used for asynchronous operations.
203 Non-Authoritative Information
The request was successful, but the response contains modified or non-authoritative information.
204 No Content
The request was successful, but there is no content to send in the response. This is typically used when the request does not need to change the user interface.
205 Reset Content
The request was successful, and the user agent should reset the document view. This is used to instruct the user agent to reset form fields.
206 Partial Content
The server is delivering only part of the resource due to a range header sent by the client.
Redirection Messages (3xx)
Redirection messages indicate that further action needs to be taken by the client to complete the request.
300 Multiple Choices
The request has more than one possible response, and the user or user agent should choose one of them.
301 Moved Permanently
The requested resource has been permanently moved to a new URL, and all future requests should be directed to the new URL.
302 Found
The requested resource resides temporarily under a different URL. This is typically used for temporary redirections.
303 See Other
The server is redirecting the client to a different resource, which can be found using a GET request at the provided URL.
304 Not Modified
The requested resource has not been modified since the last request. This is used for caching purposes.
305 Use Proxy
The requested resource is only accessible through a proxy specified in the response. This is no longer used due to security concerns.
307 Temporary Redirect
The requested resource resides temporarily under a different URL, similar to 302 but with the method and body of the original request unchanged.
308 Permanent Redirect
The requested resource has been permanently moved to a new URL, similar to 301 but ensuring the method and body of the original request are not changed.
SEE ALSO:Â Benefits of LiteSpeed Enterprise Web Server
Client Error Responses (4xx)
Client error responses indicate that there was an error with the request, typically due to incorrect syntax or bad data.
400 Bad Request
The server could not understand the request due to invalid syntax.
401 Unauthorized
The request requires user authentication. The client must provide valid credentials to access the resource.
402 Payment Required
Reserved for future use. It was intended to be used for digital payment systems.
403 Forbidden
The server understood the request but refuses to authorize it.
404 Not Found
The server cannot find the requested resource. This is one of the most common error messages.
405 Method Not Allowed
The method specified in the request is not allowed for the resource.
406 Not Acceptable
The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
407 Proxy Authentication Required
The client must first authenticate itself with the proxy.
408 Request Timeout
The server timed out waiting for the request.
409 Conflict
The request could not be completed due to a conflict with the current state of the resource.
410 Gone
The requested resource is no longer available and will not be available again.
411 Length Required
The request did not specify the length of its content, which is required by the requested resource.
412 Precondition Failed
The server does not meet one of the preconditions that the requester put on the request.
413 Payload Too Large
The request is larger than the server is willing or able to process.
414 URI Too Long
The URI provided was too long for the server to process.
415 Unsupported Media Type
The request entity has a media type which the server or resource does not support.
416 Range Not Satisfiable
The client has asked for a portion of the file, but the server cannot supply that portion.
417 Expectation Failed
The server cannot meet the requirements of the Expect request-header field.
418 I’m a Teapot
An April Fools’ joke from 1998, indicating that the server is a teapot and cannot brew coffee.
421 Misdirected Request
The request was directed at a server that is not able to produce a response.
422 Unprocessable Entity (WebDAV)
The request was well-formed but was unable to be followed due to semantic errors.
423 Locked (WebDAV)
The resource that is being accessed is locked.
424 Failed Dependency (WebDAV)
The request failed because it depended on another request that failed.
425 Too Early
Indicates that the server is unwilling to risk processing a request that might be replayed.
426 Upgrade Required
The client should switch to a different protocol.
428 Precondition Required
The server requires the request to be conditional to prevent the ‘lost update’ problem.
429 Too Many Requests
The user has sent too many requests in a given amount of time.
431 Request Header Fields Too Large
The server is unwilling to process the request because its header fields are too large.
451 Unavailable For Legal Reasons
The server is denying access to the resource as a consequence of a legal demand.
Server Error Responses (5xx)
Server error responses indicate that the server failed to fulfill a valid request.
500 Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request.
501 Not Implemented
The server does not support the functionality required to fulfill the request.
502 Bad Gateway
The server, while acting as a gateway or proxy, received an invalid response from the upstream server.
503 Service Unavailable
The server is currently unavailable due to overload or maintenance.
504 Gateway Timeout
The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server.
505 HTTP Version Not Supported
The server does not support the HTTP protocol version used in the request.
506 Variant Also Negotiates
The server has an internal configuration error: the chosen variant resource is configured to engage in content negotiation itself, which is not allowed.
507 Insufficient Storage (WebDAV)
The server is unable to store the representation needed to complete the request.
508 Loop Detected (WebDAV)
The server detected an infinite loop while processing the request.
510 Not Extended
Further extensions to the request are required for the server to fulfill it.
511 Network Authentication Required
The client needs to authenticate to gain network access.
SEE ALSO: Why Choose Rad Web Hosting Over Its Competitors
Conclusion
Understanding HTTP status codes is essential for diagnosing and resolving web server and client interactions. This comprehensive guide provides a detailed overview of each class of HTTP status codes, helping developers and IT professionals troubleshoot issues effectively and ensure smooth communication between clients and servers.
[…] you deploy code as small units (functions) that execute in response to specific triggers, such as HTTP requests, file uploads, or database events. This removes the need for managing the server and infrastructure […]