HTTP

HTTP 411 Length Required vs 505 HTTP Version Not Supported

HTTP 411 (Length Required) is a 4xx Client Error response, while 505 (HTTP Version Not Supported) is a 5xx Server Error response. 411 indicates that the server refuses to accept the request without a Content-Length header. In contrast, 505 means that the server does not support the HTTP version used in the request.

Description

The server refuses to accept the request without a Content-Length header.

When You See It

When sending a request body without specifying Content-Length.

How to Fix

Include a Content-Length header in your request.

Description

The server does not support the HTTP version used in the request.

When You See It

When a client uses an HTTP version the server doesn't support.

How to Fix

Use a supported HTTP version (typically HTTP/1.1 or HTTP/2).

Key Differences

1.

411 is a 4xx Client Error response, while 505 is a 5xx Server Error response.

2.

HTTP 411: The server refuses to accept the request without a Content-Length header.

3.

HTTP 505: The server does not support the HTTP version used in the request.

4.

You encounter 411 when when sending a request body without specifying Content-Length.

5.

You encounter 505 when when a client uses an HTTP version the server doesn't support.

When to Use Which

For 411 (Length Required): Include a Content-Length header in your request. For 505 (HTTP Version Not Supported): Use a supported HTTP version (typically HTTP/1.1 or HTTP/2).

Learn More