Content-Length header

The HTTP Content-Length header indicates the size, in bytes, of the message body sent to the recipient.

Content-Length is limited in that the message size must be known up front, before sending the headers, which is a problem when content is dynamically generated or streamed.

Header typeRequest header, Response header, Content header
Forbidden request headerYes
CORS-safelisted response headerYes

Syntax

http
Content-Length: <length>

Directives

<length>

The length in octets.

Specifications

See also