411 Length Required
This is an educational reference page about HTTP 411 Length Required. The page itself is served as 200 OK so it can be indexed as HTTP documentation.
The request did not specify the length of its content, which is required by the requested resource.
What it means
HTTP 411 Length Required means the server refuses the request because it requires a Content-Length header.
Common causes
- The client sent a request body without a Content-Length header.
- A proxy or server does not accept chunked transfer encoding for this endpoint.
- The origin needs the body size before deciding whether to accept or buffer the request.
Where you see it
- Upload endpoints that require the full request size before accepting data.
- Older HTTP gateways or reverse proxies that do not support chunked request bodies.
- API clients that stream a body without calculating Content-Length first.
Headers involved
- Content-Length tells the server the exact request body size in bytes.
- Transfer-Encoding: chunked can avoid Content-Length, but only when the whole proxy chain supports it.
- Content-Type still describes the body format; it does not replace Content-Length.
How to fix it
- Send Content-Length when the request has a known body size.
- Check whether a proxy removed or changed request framing headers.
- Use streaming or chunked uploads only when every proxy and origin in the path supports them.
Client fixes
- Let the HTTP client library calculate Content-Length when sending a buffered body.
- Avoid manually deleting Content-Length from POST, PUT, and PATCH requests.
- Use a streaming upload API only when the server documents support for it.
Server fixes
- Document whether endpoints require Content-Length or accept chunked uploads.
- Make proxy and origin request-body handling consistent.
- Return a clear JSON error body when rejecting requests without Content-Length.
Example response
HTTP/1.1 411 Length Required
Content-Type: application/json
{"error":"Content-Length header required"}
Developer notes
411 is about request framing, not validation of the body contents. If the body is present but invalid, 400 or 422 is usually more accurate.
Questions
What does HTTP 411 mean?
HTTP 411 means the server requires the request to include Content-Length before it will process the body.
How do I fix 411 Length Required?
Send a correct Content-Length header or adjust the client/proxy so the origin receives supported request framing.