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/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.