What Is a 505 Status Code?
The server does not support, or refuses to support, the major version of HTTP that was used in the request message.
The server is indicating that it is unable or unwilling to complete the request using the same major version as the client, as described in Section 2.6 of RFC7230, other than with this error message. The server SHOULD generate a representation for the 505 response that describes why that version is not supported and what other protocols are supported by that server.
- Source: RFC7231 Section 6.6.6
505 CODE REFERENCES
Rails HTTP Status Symbol
Go HTTP Status Constant
Symfony HTTP Status Constant
Python2 HTTP Status Constant
Python3+ HTTP Status Constant
Python3.5+ HTTP Status Constant
Apache HttpComponents Core
505 status code example
Here is an example of a request and response that could result in a 505 HTTP Version Not Supported status code:
PUT /example HTTP/2.0
Hello, this is an example request body.
HTTP/1.1 505 HTTP Version Not Supported
Date: Wed, 24 Mar 2023 14:28:00 GMT
Server: Apache/2.4.48 (Unix)
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<title>505 HTTP Version Not Supported</title>
<h1>HTTP Version Not Supported</h1>
<p>The server does not support the HTTP protocol version used in the request.</p>
In this example, the client is attempting to use the HTTP/2.0 protocol to send a PUT request to the server. However, the server only supports the HTTP/1.1 protocol, so it responds with a 505 HTTP Version Not Supported status code. The response also includes a message explaining that the server does not support the HTTP protocol version used in the request.
How to fix a 505 status code
If you receive a 505 HTTP Version Not Supported status code, it means that the HTTP protocol version used in the request is not supported by the server. Here are a few ways to address this issue:
- Check the protocol version: The first step is to ensure that you are using a supported protocol version. HTTP/1.1 is the most widely used protocol version, and most servers support it. If you are using a different version, try switching to HTTP/1.1 and see if the error goes away.
- Update the server: If the server does not support the protocol version you need, consider upgrading the server to a version that supports it. Alternatively, you can check if there is a patch or plugin available that adds support for the required protocol version.
- Use a proxy server: If you are unable to upgrade the server or switch to a supported protocol version, you can use a proxy server that supports the desired protocol version. The proxy server will handle the request on your behalf and forward the response back to you.
- Contact the server administrator: If you have tried the above solutions and still cannot resolve the issue, contact the server administrator for assistance. They may be able to provide additional information or suggest a workaround.
In general, resolving a 505 HTTP Version Not Supported error involves ensuring that the client and server are using compatible protocol versions.
What is the difference between a 500 status code and a 505 status code?
A 500 Internal Server Error status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This error can occur due to a variety of reasons, such as a programming error, an insufficient system resource, or a misconfiguration of the server.
On the other hand, a 505 HTTP Version Not Supported status code indicates that the server does not support the HTTP protocol version used in the request. This error occurs when the client attempts to use an HTTP protocol version that the server does not recognize or support.
- Learn about web development
- Learn about SEO
- Web development services from WebFX
- SEO services from WebFX
- MDN Web Docs