Content-Length Header Explained
What the HTTP Content-Length header does and when it's used.
Published October 13, 2026
The Content-Length header declares the size of the message body in bytes.
Key points
- Lets the receiver know exactly how much data to expect and when the body ends
- Omitted when using chunked transfer encoding, since the total size isn't known upfront