HTTP 411 Length Required means the server refuses to accept the request because the Content-Length header is missing. The server needs to know the size of the request body before processing it.
411 Length RequiredPOST /upload/photo HTTP/1.1
Host: www.example.com
User-Agent: curl/8.6.0
Content-Type: image/jpegHTTP/1.1 411 Length Required
Content-Type: text/html; charset=utf-8
Content-Length: 196
<!doctype html>
<html lang="en">
<head>
<title>411 Length Required</title>
</head>
<body>
<h1>Length Required</h1>
<p>The server requires a Content-Length header to process this request.</p>
</body>
</html>Include the Content-Length header with the exact byte size of the request body.
curl -v -X POST -H 'Content-Length: 13' -d '{"key":"val"}' https://api.example.com/If the request size is unknown upfront, check if the server supports Transfer-Encoding: chunked as an alternative.
The client is sending a request body without specifying its length, and the server requires it.
| Specification | Section |
|---|---|
| HTTP Semantics | RFC 9110 §15.5.12 |
This reference was compiled from official RFCs, protocol specifications, and hands-on troubleshooting experience. AI tools were used primarily for formatting and organizing the content on the page.