Skip to content

4xx Client error

411 Length Required

The server needs a Content-Length header.

What 411 means

The request had a body (or chunked encoding) without a Content-Length the server requires.

Common causes

  • A POST with no body and no Content-Length (send Content-Length: 0).

How to fix it

If you're calling an API

  • Send Content-Length, or an empty body with Content-Length: 0.

If you run the server

  • Accept chunked bodies where possible.

Should you retry?

After adding Content-Length.

Example response

HTTP
HTTP/1.1 411 Length Required
Content-Type: application/problem+json

{
  "type": "about:blank",
  "title": "Length Required",
  "status": 411,
  "detail": "The server needs a Content-Length header."
}

Related headers: Content-Length.

Defined in: RFC 9110 (HTTP Semantics). 411 is a client error: change the request before retrying.

Debugging an API call? Convert your request with the cURL converter, check the response with the JSON formatter, or see whether the API is down on its status page.

HTTP 411 FAQ

What does HTTP 411 mean?

411 Length Required: The server needs a Content-Length header. The request had a body (or chunked encoding) without a Content-Length the server requires.

Is 411 a client or server error?

It's a client error (4xx): something about the request needs to change before it can succeed.

How do I fix a 411 error?

Send Content-Length, or an empty body with Content-Length: 0.

Should I retry after a 411?

After adding Content-Length.

Other 4xx status codes

All HTTP status codes