411 (Length Required)
The 411 (Length Required) HTTP status code indicates the server is unwilling to fill a request with an upload body submitted without a Content-Length header.
Writing responses (servers)
Typically servers will use 411 Length Required
when a client begins sending an upload body, but the server is not prepared to buffer an indefinite amount of data. Always follow the guidelines for closing client connections to ensure that the client receives and reads the status code; otherwise the client may see a connection reset instead of the more useful HTTP status code.
Reading responses (clients)
Clients should first try making uploads with Expect: 100-continue so that upload bandwidth is not wasted on a server that might return an error due to the payload size.
The request may be retried with a Content-Length header that specifies the length of the upload 404 Not Found for additional handling.
Overview table
- Name
- 411
- Message
- 411 Length Required
- Description
- The request is missing a Content-Length header
- Specification
- RFC 7231: HTTP/1.1 Semantics and Content ยง6.5.10. 411 Length Required