206 Partial Content

HTTP 206 is a response code servers use when sending a portion of the message.

For example, when streaming a video, you want to receive it in chunks (because why waste the bandwidth if you only need a small fraction of the file). You request a portion of the file, by including the Range HTTP header:

Range: bytes=0-

The above header asks the server to send the portion of the data starting from the 0th byte and beyond.

If the range is valid, and the server supports range requests, you will receive the requested chunk with a 206 Partial Content status code. When responding to a range request, the server includes the Content-Range header indicating which bytes server is responding with.

Servers are free to ignore the Range header, in which case, they will return the entire resource in one swoop with a 200 OK status code.

Transport layer

Range requests (also known as byte serving) happen on the application layer (HTTP).

Regardless of whether a client uses a range request, the data will be broken down in chunks and transported in TCP or UDP packets.

See also