GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

411 Length Required

The HTTP 411 Length Required client error response status code indicates that the server refused to accept the request without a defined Content-Length header.

The HTTP **`411 Length Required`** [client error response](/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server refused to accept the request without a defined Content-Length header.

> [!NOTE]
> When sending data in a series of chunks, the `Content-Length` header is omitted, and at the beginning of each chunk, the length of the current chunk needs to be included in hexadecimal format.
> See Transfer-Encoding for more details.

## Status

```http
411 Length Required
```

## Examples

### Chunked POST request

The following request is sent chunked, which is the default method of sending data in some cases, such as when [writing to streams](https://nodejs.org/api/http.html#requestwritechunk-encoding-callback):

```http
POST /translate/de HTTP/1.1
Host: api.example.com
Content-Type: application/json
Transfer-encoding: chunked

2C
{"text": "Hurry up, Ayşe is hungry!"}
0
```

In this case, the server is expecting a request in one part with a Content-Length header and returns a 411 response:

```http
HTTP/1.1 411 Length Required
Content-Type: application/json
Content-Length: 110

{
"message": "Requests must have a content length header.",
"documentation": "http://api/example.com/docs/errors",
}
```

## Specifications

## See also

- [HTTP response status codes](/docs/Web/HTTP/Reference/Status)
- Content-Length
- Transfer-Encoding

source: MDN Web Docs mirror · page

Cite this

"411 Length Required". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/411

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·