HTTP 411 Length Required
HTTP 411 Length Required means the server refuses the request because it has a body but no Content-Length header. Some servers and proxies will not accept…
Quick answer
HTTP 411 Length Required means the server refuses the request because it has a body but no Content-Length header. Some servers and proxies will not accept chunked request bodies, so the client must send the exact body length.
Last updated · Maintained by FreeAIToolz · How we test
What does HTTP 411 Length Required mean?
It usually appears with hand-written HTTP clients, streaming uploads or empty POST requests sent without Content-Length: 0.
| Status code | 411 |
|---|---|
| Name | Length Required |
| Class | 4xx Client Error |
| Defined in | RFC 9110 §15.5.12 |
| Cacheable by default | No, unless Cache-Control says so |
| Safe to retry automatically? | No: change the request first |
| Related headers | Content-Length |
What causes HTTP 411?
- POST or PUT without Content-Length, including empty bodies.
- Chunked transfer encoding sent to a server that does not accept it.
How do I fix HTTP 411?
- Send Content-Length (Content-Length: 0 for empty bodies).
- Buffer the body before sending if the server cannot accept chunked uploads.
What should a client do after HTTP 411?
Add Content-Length and retry.
Does HTTP 411 affect SEO?
No SEO impact.
Example 411 response
HTTP/1.1 411 Length Required
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json
{"error":{"status":411,"message":"Length Required"}} How to return 411 Length Required in code
Express (Node.js)
res.status(411).json({ error: 'Length Required' }); Next.js route handler
return Response.json({ error: 'Length Required' }, { status: 411 }); FastAPI (Python)
raise HTTPException(status_code=411, detail="Length Required") PHP
http_response_code(411); Nginx
location = /example {
return 411;
} Other 4xx status codes
The request contains an error or cannot be fulfilled as sent. Fix the request before retrying.
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 499 Client Closed Request
Frequently asked questions
Why does an empty POST return 411?
Can I use chunked uploads instead?
Is 411 a client or server error?
Related
- 413 Content Too Large HTTP 413 Content Too Large (formerly Payload Too Large or Request Entity Too Large) means the request body is .
- 400 Bad Request HTTP 400 Bad Request means the server cannot process the request because of a client error, such as malformed .
- 415 Unsupported Media Type HTTP 415 Unsupported Media Type means the server will not accept the request body’s format, as stated by its C.
- Open the HTTP Status Codes Reference → Free, no signup.