What does HTTP status code 411 mean?
The 411 Length Required status code indicates that the server rejects the request because it requires a Content-Length header to safely allocate buffers for the request body.
When to use it in APIs
Typically enforced on file upload or ingestion routes to prevent memory exhaustion attacks.
How it compares to other codes
- 413 Payload Too Large: Fails because the body is too big. 411 fails because the body size was not declared.