The server refuses a request with a body but no Content-Length header, because it will not accept a chunked or unbounded body.
Defined in RFC 9110 §15.5.12 — 411 Length Required · MDN reference
Older servers, some object stores and signed-upload endpoints that need the size up front, for example to verify a signature or enforce a quota before reading.
A test for clients that stream request bodies. Check what your HTTP library sends when the body is a stream of unknown length — it is usually chunked encoding, and some servers refuse it.
Send Content-Length. Buffer the body, or compute its size before sending, instead of streaming it with Transfer-Encoding: chunked. Retrying the same streamed request will fail the same way.
1 endpoint in this playground answers with 411. Every one is free, needs no signup, and can be called from the browser or with curl.
GET https://funapi.dev/api/faults/v1/status/{code} — Returned on request (Fault Injection API) Open & run this endpointAll HTTP status codes · All 39 mock REST APIs · Getting started guide
Last updated