Both
HTTP Content-Length Header
Indicates the size of the response body in bytes. Helps the client know how much data to expect and when the response is complete.
Purpose
Tells the receiver the exact size of the message body in bytes for proper data handling.
Content-Length: <bytes> Example: Content-Length: 348
Code Examples
See how to use the Content-Length header in different tools and languages.
Related Headers
Content-Type
Indicates the media type (MIME type) of the resource being sent. Tells the client how to interpret the response body.
Content-Encoding
Indicates which compression algorithm was applied to the response body. The client must use the same algorithm to decompress the data.
Transfer-Encoding
Specifies the transfer encoding applied to the message body. Chunked encoding is used when the response size is not known in advance.
Test Your APIs
content-length headerhttp content-lengthhttp headers guide