HTTPQUERY
English

505 HTTP Version Not Supported

Usage

The 505 HTTP Version Not Supported status code means the server does not support the major protocol version from the request. The server is expected to generate a response explaining why the specific HTTP protocol version is not supported and listing which HTTP protocols the server is willing to accept for this URI.

Example

The client requests a resource using HTTP/2 and the server responds with a 505 HTTP Version Not Supported status code because the server only supports HTTP/1.1.

Request

GET / HTTP/2
Host: example.com

Response

HTTP/1.1 505 HTTP Version Not Supported
Content-Type: text/html; charset=UTF-8
Content-Length: 141

<html>
  <head>
    <title>Protocol Not Supported</title>
  </head>
  <body>
    <p>HTTP/2 not supported. Use HTTP/1.1.</p>
  </body>
</html>

How to fix

Identify the protocol mismatch. The server log or response body names which HTTP version was rejected and which versions the server accepts.

On the client side:

On the server side:

Verify the fix by making a request with the previously rejected HTTP version and confirming a successful response.

Code references

.NET

HttpStatusCode.HttpVersionNotSupported

Rust

http::StatusCode::HTTP_VERSION_NOT_SUPPORTED

Rails

:http_version_not_supported

Go

http.StatusHTTPVersionNotSupported

Symfony

Response::HTTP_VERSION_NOT_SUPPORTED

Python3.5+

http.HTTPStatus.HTTP_VERSION_NOT_SUPPORTED

Java

java.net.HttpURLConnection.HTTP_VERSION

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED

Angular

@angular/common/http/HttpStatusCode.HttpVersionNotSupported