What is The HTTP 505 Error Code and How to Fix It (Simple Guide)
ErrorsLearn what the HTTP 505 error (HTTP Version Not Supported) is and how to fix your HTTP version while web scraping to solve it.


Nerijus Kriaučiūnas
Key Takeaways
-
The 505 (HTTP Version Not Supported) error occurs when the server cannot process the request because the HTTP protocol version is not supported.
-
Typical code 505 causes are an outdated browser, server-side settings, or firewall configuration, and the client's use of proxy servers.
-
Error 505 differs from other 5xx and 4xx error codes by indicating an unsupported HTTP version.
-
When web scraping or automating tasks, 505 code errors can often be solved by changing your HTTP version.
Every browser, web scraper, mobile application, or other client mostly communicates using a specific version of the Hypertext Transfer Protocol (HTTP). If the client and server cannot agree on an HTTP version, the request fails, and no data is exchanged.
Web scrapers and automation tools may also encounter issues, labeled as 505 errors. Understanding these errors and knowing how to adjust your HTTP version can help ensure successful communication with servers.
What Does the HTTP 505 Error Code Mean?
Just as software updates on everyday devices bring security improvements and new features, HTTP protocol versions improve web communication. And just as with consumer software, server settings might not accept any different HTTP versions than required.
That’s what the HTTP 505 error (HTTP Version Not Supported) code means - the server cannot handle the HTTP version you are using in your requests. Server software may require an updated HTTP version, or an older supported HTTP version is needed.
You are unlikely to see a 505 error when using popular web browsers, such as Google Chrome or Mozilla Firefox. They are regularly updated in the background and even maintain backward compatibility with various HTTP versions to ensure a seamless browsing experience.
When web scraping or performing other web automation tasks, the 505 error is one of the most common proxy error codes . Unlike modern browsers, automation tools have many moving parts and are often custom-built, which creates reasons for the HTTP version not supported status code to appear.
Common Causes of the HTTP 505 Error
HTTP error 505 represents a version clash between the server and the client’s request. If the client requests a newer HTTP version unsupported by the server, or vice versa, the mismatch results in a 505 error. There are various reasons for such a mismatch.
- An outdated browser is a possible reason when browsing the web, but it might also be the cause of a 505 error when a headless browser is set up incorrectly. For example, Selenium relies on the local Chrome/Chromedriver, and misconfigured versions can lead to issues.
- Server settings configuration issues, such as outdated server software, can also create HTTP version mismatches. The supported HTTP versions list might require newer or older HTTP versions. The HTTP version list might also be affected by load balancers or APIs.
- Firewalls or other security software might create an HTTP version not supported status code as they block or modify requests. In some cases, server software intentionally blocks certain requests, such as those from bots.
- Proxy servers used by the client might alter or downgrade the HTTP version in requests, which can trigger the error 505. This is especially true if the proxy only supports HTTP/1.1, but the client requests HTTP/2 or a higher version.
505 vs Other 5xx Errors
Before deciding on how to solve the HTTP 505 error code, it’s important to know whether it’s actually an incorrect HTTP protocol version that’s causing the problems. Here’s how the 505 error code compares to some other 5xx errors.
- 500 (Internal Server Error) is the most generic 5xx error, indicating that the server can’t fulfill the request for an unknown reason. Unlike the 505 error, the reason why the server failed isn’t specified.
- 502 (Bad Gateway) signifies a server-side issue where a gateway or proxy received an invalid response from the backend server. While a 505 error relates to a protocol version mismatch, 502 is about failed communication between servers in general.
- 503 (Service Unavailable) indicates that the server is currently overloaded or down for maintenance. Unlike 505 issues, where the HTTP protocol version is not supported, the 503 error is a temporary unavailability.
- 504 (Gateway Timeout) happens when the proxy or gateway server times out waiting for a response. Both 505 and 504 errors indicate problems in server communication. However, 504 is related to a timeout, while 505 is associated with HTTP protocol version incompatibility.
The 505 message may also be confused with some 4xx errors. 403 (Forbidden) error also indicates issues with accessing web resources, but it is due to a lack of access permissions. Similarly, the 405 (Method Not Allowed) error indicates that the server recognizes the requested HTTP method but it’s disabled or not allowed.
In all of the above cases, the 505 error is distinguished by the protocol mismatch, denying request fulfillment. Solving 505 codes relies on addressing the underlying HTTP protocol version issues.
If you’re using a regular browser, that’s unlikely to be the true issue. If you’re performing web scraping or other automation tasks, the error may indicate that your setup is incorrect.
How to Fix the HTTP 505 Error
Conclusively, fixing the HTTP 505 error requires server-side access. If you have it, update the server software and configure proper HTTP version settings. In contexts such as web scraping or automation, you rarely have control over the server, so you’re left with adjusting your code or proxies.
The most viable solution is to determine the HTTP protocol version required and adjust the requests on the client side. Let’s say you are using a Selenium Python scraper to access the website and encounter a 505 code error.
Using Selenium alone won’t allow you to detect and control the HTTP protocol version. The httpx library (or some others, such as aiohttp or Selenium Wire) will be needed to inspect and modify HTTP requests.
First, we need to check the HTTP version used in failed requests to ensure that our future HTTP version aligns with the server’s settings.
- Open the target website in your Chrome browser.
- Press F12 and select ’Inspect’ to open Developer Tools.
- Go to the ’Network’ tab, and you’ll see listings of all network requests.
- The column named ’Protocol’ will show the HTTP version used for each request (for example, http/1.1 or h2).
- The ’Protocol’ column might need to be enabled additionally. For this, right-click on any header and select it in ’Header Options.’
Now, observe the most common HTTP version used in the browser developer tools. In case the server accepts only http/1.1 requests, we will need to change our HTTP version. Here’s how the code might look in a Python script that uses the httpx library.
import httpx
url = "https://example.com"
headers = {"User-Agent": "Mozilla/5.0"}
# Force HTTP/1.1 by disabling HTTP/2
client = httpx.Client(http2=False)
response = client.get(url, headers=headers)
print(response.status_code)
Simple solutions applicable for web browsing, such as switching browsers or disabling HTTP/3, may resolve 505 errors for manual users. However, in some cases, servers intentionally restrict HTTP versions as an anti-bot measure. As such, controlling the HTTP versions via libraries like httpx is more effective.
Conclusion
The 505 (HTTP Version Not Supported) error is more common when web scraping or automating tasks than when using a simple browser. In many cases, a 505 error is a clear signal to check and potentially override the HTTP version used in your requests - the basics of which we have covered in this article.