Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. HTTP response status codes
  5. 411 Length Required

411 Length Required

The HTTP411 Length Requiredclient error response status code indicates that the server refused to accept the request without a definedContent-Length header.

Note:When sending data in a series of chunks, theContent-Length header is omitted, and at the beginning of each chunk, the length of the current chunk needs to be included in hexadecimal format.SeeTransfer-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 whenwriting to streams:

http
POST /translate/de HTTP/1.1Host: api.example.comContent-Type: application/jsonTransfer-encoding: chunked2C{"text": "Hurry up, Ayşe is hungry!"}0

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

http
HTTP/1.1 411 Length RequiredContent-Type: application/jsonContent-Length: 110{  "message": "Requests must have a content length header.",  "documentation": "http://api/example.com/docs/errors",}

Specifications

Specification
HTTP Semantics
# status.411

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp