HTTP 206 is a response code servers use for successful range requests.
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:
The above header asks the server to send the slice of the data starting from the 0th byte and beyond. This is also known as byte serving or range requests.
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.
Range requests 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.
- 416 Range Not Satisfiable status code is returned when the range request fails.