Content-Length
The size of the message body in decimal octets. Required when a body is present (unless chunked).
BothSyntax
Content-Length: <length>Example values
| Value | Explanation |
|---|---|
| 42 | Body is 42 bytes |
| 0 | Empty body |
cURL usage
curl -X POST -d '{"a":1}' https://api.example.com # Auto-setCommon mistakes
Mismatch between Content-Length and actual body; required for POST/PUT.