Some servers reject request bodies that arrive without a length they accept. This often appears when a streaming client and an older intermediary disagree about request framing. Use the client's supported length handling rather than manually guessing bytes. A wrong Content-Length can break the exchange or introduce parsing ambiguity, particularly when several intermediaries are involved.
411 Length Required
The receiving server requires an explicit request length before it will accept the operation.
All HTTP status codes
What does HTTP 411 mean?
An investigation example
Illustrative integration investigation
Response: 411 Length Required
Streaming upload passes through a gateway requiring a known length.
Action: use a compatible upload mode or repair gateway support.
Verify: the client sends the exact byte length and the complete body reaches the application.Common causes
- A client streams a body without a known size to an endpoint that requires Content-Length.
- A proxy strips or changes request framing before forwarding the upload.
Diagnose the response
Check how the client frames the body and whether a gateway requires Content-Length for that endpoint.
- Inspect the request reaching the rejecting server, including any change from HTTP/2 to HTTP/1.1 at a proxy. The client's original framing may differ from the forwarded request.
- Use the client library's normal body or file-upload API so it can calculate the correct byte length. Avoid manually setting conflicting framing headers.
- If streaming is essential, verify that every intermediary and the endpoint support it. Otherwise buffer or determine the body size within the application's documented upload limits.
What it means for website monitoring
An ordinary page request may never exercise this path. Test the affected body-bearing operation through the same gateway used by production clients.