Types of HTTP Status Codes
Before moving on to 1xx status codes, it is best to know that there are five categories into which we can divide HTTP response codes.
- 1xx Status Codes for information.
- 2xx Status Codes indicate that a request has been processed properly.
- 3xx Status Codes for redirection advise the client that the requested resource is accessible elsewhere on the server.
- 4xx Status Codes for client errors primarily comes from the browser, because the required parameters to visit the requested URL are lacking.
- 5xx Status Codes for Server Errors indicate that the request could not be processed.
Introduction
A 5xx Server error status code indicates that even if the request seems valid, the server was unable to process it. You should check your server right away if your website is suffering 5xx server failures.
To identify the cause of your server's improper response if you are hosting it, you must begin debugging. You must contact the external hosting provider if you're utilizing one, so they can take a look.
500 Internal Server Error Status Code
The server has encountered a problem that it is unable to resolve, as indicated by the 500 Internal Server Error status code.
When viewed from an SEO perspective, the 500 Internal Server Error denotes a server issue rather than the availability of the content. The link equity will rapidly decline as both users and bots are lost.
References for Code 500
- HTTP Status Constant for Python3.5+
http.HTTPStatus.INTERNAL_SERVER_ERROR
- HTTP Status Constant for Python2
httplib.INTERNAL_SERVER_ERROR
- HTTP Status Constant for Go
http.StatusInternalServerError
- HTTP Status Constant for Python3+
http.client.INTERNAL_SERVER_ERROR
- HTTP Status Symbol for Rails
:internal_server_error
- HTTP Status Constant for Symfony
Response::HTTP_INTERNAL_SERVER_ERROR
501 Not Implemented Server Code
When the server cannot support the request method for any resource and does not recognize the request method, this is the proper response.
A 501 answer is cacheable by default, unless the method specification or explicit cache controls specify otherwise1.
References for Code 501
- HTTP Status Constant for Python2
httplib.NOT_IMPLEMENTED
- HTTP Status Symbol for Rails
:not_implemented
- HTTP Status Constant for Python3+
http.client.NOT_IMPLEMENTED
- HTTP Status Constant for Go
http.StatusNotImplemented
- HTTP Status Constant for Python3.5+
http.HTTPStatus.NOT_IMPLEMENTED
- HTTP Status Constant for Symfony
Response::HTTP_NOT_IMPLEMENTED
502 Bad Gateway Status Code
The server got an invalid response while acting as a gateway to handle the response, as indicated by the response code 502 Bad Gateway.
References for Code 502
- HTTP Status Symbol for Rails
:bad_gateway
- HTTP Status Constant for Python2
httplib.BAD_GATEWAY
- HTTP Status Constant for Python3.5+
http.HTTPStatus.BAD_GATEWAY
- HTTP Status Constant for Python3+
http.client.BAD_GATEWAY
- HTTP Status Constant for Go
http.StatusBadGateway
- HTTP Status Constant for Symfony
Response::HTTP_BAD_GATEWAY
503 Service Unavailable Status Code
Due to a brief overload or scheduled maintenance, the server is presently unable to handle the request. This situation will most likely pass after some time.
In order to advise the client on how long to wait before retrying the request, the server MAY provide a Retry-After header field1.
It should be noted that a server is not required to use the 503 status code if it becomes overloaded. Some servers may just flat-out decline the connection.
References for Code 503
- HTTP Status Symbol
:service_unavailable
- Python3+ HTTP Status Constant
http.client.SERVICE_UNAVAILABLE
- Symfony HTTP Status Constant
Response::HTTP_SERVICE_UNAVAILABLE
- Go HTTP Status Constant
http.StatusServiceUnavailable
- Python3.5+ HTTP Status Constant
http.HTTPStatus.SERVICE_UNAVAILABLE
- Python2 HTTP Status Constant
httplib.SERVICE_UNAVAILABLE
504 Gateway Timeout Status Code
The server, which was serving as a gateway or proxy, failed to finish the request because it did not get a timely answer from an upstream server it needed to connect to.
References for Code 504
- HTTP Status Constant for Python3+
http.client.GATEWAY_TIMEOUT
- HTTP Status Constant for Go
http.StatusGatewayTimeout
- HTTP Status Constant for Python3.5+
http.HTTPStatus.GATEWAY_TIMEOUT
- HTTP Status Symbol for Rails
:gateway_timeout
- HTTP Status Constant for Python2
httplib.GATEWAY_TIMEOUT
- HTTP Status Constant for Symfony
Response::HTTP_GATEWAY_TIMEOUT
505 HTTP Version Not Supported Status Code
The major version of HTTP that was used in the request message is not supported by the server or is not offered for support.
The server is indicating that it cannot or will not process the request using the same major version as the client by returning this error message. The server SHOULD produce a 505 response representation that explains why that version is not supported and lists the various protocols that the server DOES support.
References for Code 505
- HTTP Status Symbol for Rails
:http_version_not_supported
- HTTP Status Constant for Python3+
http.client.VERSION_NOT_SUPPORTED
- HTTP Status Constant for Symfony
Response::HTTP_VERSION_NOT_SUPPORTED
- HTTP Status Constant for Go
http.StatusHTTPVersionNotSupported
- HTTP Status Constant for Python2
httplib.VERSION_NOT_SUPPORTED
- HTTP Status Constant for Python3.5+
http.HTTPStatus.VERSION_NOT_SUPPORTED
506 Variant Also Negotiates Status Code
The selected variant resource is set up on the server to engage in transparent content negotiation itself, which prevents it from serving as a valid point of termination for the negotiation process.
References for Code 506
- HTTP Status Constant for Symfony
Response::HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL
507 Insufficient Storage Status Code
The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request.
This condition is considered to be temporary. If a user activity caused the request to receive this status code, it MUST NOT be repeated until a different user action is used to make the request.
References for Code 507
- HTTP Status Symbol for Rails
:insufficient_storage
- HTTP Status Constant for Symfony
Response::HTTP_INSUFFICIENT_STORAGE
508 Loop Detected Status Code
When processing a request with "Depth: infinity," the server had to stop because it had reached an infinite loop. This status denotes that the whole operation was unsuccessful.
References for Code 508
- HTTP Status Constant for Symfony
Response::HTTP_LOOP_DETECTED
510 Not Extended Status Code
The request does not adhere to the resource access policy. The server should respond with all the data required by the client to submit an extended request.
How the extensions tell the client is not covered by the scope of this specification.
If the 510 response includes details about extensions not included in the first request, the client MAY resubmit the request if it reasonably believes it can satisfy the extension policy by revising it in light of the details in the 510 response. If not, the client MAY make any entity in the 510 response available to the user because it might contain valuable diagnostic data.
References for Code 510
- HTTP Status Symbol for Rails
:not_extended
- HTTP Status Constant for Symfony
Response::HTTP_NOT_EXTENDED
511 Network Authentication Required Status Code
To access the network, the client must authenticate.
The representation of the response SHOULD include a link to a page where the user can enter their credentials (e.g., with an HTML form).
It should be noted that the 511 response SHOULD NOT include a challenge or the login interface itself because browsers would display them as being connected to the URL that was originally requested, thus confusing users.
The 511 status is meant to be used by intercepting proxies that are interposed as a way to control access to the network; it SHOULD NOT be created by origin servers.
Caches MUST NOT keep responses with the status code 511 on their servers.
The 511 status code is intended to lessen issues brought on by “captive portals” to software, particularly non-browser agents, which look for a response from the server that handled the request rather than the network infrastructure in between. Its goal is to lessen the harm that captive portal deployment can do, not to promote it.
When a network administrator wants to demand authentication, agreement to conditions, or other user involvement before giving access, they typically do so by identifying “unknown clients” based on their Media Access Control (MAC) addresses.
All traffic to unknown clients is then prohibited, with the exception of traffic on TCP port 80 that is forwarded to an HTTP server (the “login server”) specifically designed for “logging in” such clients, as well as traffic to the login server itself.
For instance, after connecting to a network, a user agent might send the following HTTP request on TCP port 80:
GET /index.htm HTTP/1.1
Host: www.example.com
A 511 response would be sent by the login server in response to such a request:
HTTP/1.1 511 Network Authentication Required
Content-Type: text/html
<html>
<head>
<title>Network Authentication Required</title>
<meta http-equiv="refresh" content="0; url=https://login.example.net/">
</head>
<body>
<p>You need to <a href="https://login.example.net/">
authenticate with the local network</a> in order to gain
access.</p>
</body>
</html>
The META HTML element in this case sends the user agent to the login server, and the 511 status code ensures that non-browser clients won't view the answer as coming from the origin server.
References for Code 511
- HTTP Status Constant for Symfony
Response::HTTP_NETWORK_AUTHENTICATION_REQUIRED
599 Network Connect Timeout Error
Some HTTP proxies utilize this status code, which is not defined in any RFCs, to inform a client in front of the proxy that a network connection timeout occurred behind the proxy.
Conclusion
These are the HTTP status or problem codes that appear in the web browser window the most frequently. When a difficulty arises while processing a client's request for a resource, the web server sends back a 5xx error code.