Applies to: Protocol and format interpretation for developers inspecting authorized media delivery.
The useful distinctions
- Content-Length is an octet count.
- Its value is not a character count.
- A HEAD response can advertise the corresponding GET length.
Establish a byte-count baseline
Start a length investigation with an example whose encoding is unambiguous. The synthetic body here consists of five ASCII letters and contains no trailing newline, so its five-character count also happens to be five bytes. That coincidence is useful for a baseline but should not become a rule for programme titles in other scripts. Write down the exact encoding and whether a final line terminator belongs to the body before comparing a calculated count with a header.
Change one representation detail at a time
If exploring a Unicode case locally, keep a separate calculation of encoded bytes rather than estimating from what appears on screen. Visually similar text can also use different code-point sequences, so an editor's character count is a poor substitute for a byte count. Compression adds another independent representation step. In a real capture, distinguish a declared size from the number of bytes actually received; a truncated response can leave those values different. Likewise, do not infer that every response without this field lacks a body. Framing rules depend on the protocol and message context, which need their own inspection. For a multilingual text fixture, count the serialized UTF-8 bytes instead of letters shown on screen. Record the encoding with the byte count so another reviewer can reproduce the result exactly.
Worked example · synthetic
The body contains exactly hello with no trailing newline. Its encoded UTF-8 length is five bytes; that result should not be generalized to non-ASCII programme text.
Synthetic text example; no network operation has been performed.
HTTP/MIME line endings are CRLF. Request URL context, where labelled, is commentary rather than a wire field. No message was transmitted.
HTTP/1.1 200 OK
Date: Sun, 08 Nov 2026 08:00:00 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 5
helloCheck the interpretation
- Count encoded octets.
- Specify whether the final newline belongs to the body.
- Keep advertised and received lengths separate.