206 Partial Content status code indicates that the server is sending only a portion of the requested resource. This status code is commonly used when the client has sent a
Range header in its request, indicating that it only wants a specific portion of the resource.
Here’s a breakdown of its meaning and usage:
- Partial Content Delivery: Instead of sending the entire resource, the server sends only the part (or parts) specified by the client.
- Resume Interrupted Downloads: One common use case for the <code>206 status code is when a large download is interrupted, and the client needs to continue downloading from where it left off. By sending a
Rangerequest, the client can request the remainder of the file without starting from the beginning.
- Adaptive Streaming: Another use case is adaptive streaming of multimedia content. As the network conditions change, a video player might request different portions of a video file at different quality levels.
- Response Headers: When responding with a
206 Partial Contentstatus, the server will also include a
Content-Rangeheader to specify which part of the resource is being sent.
For example, if a client requests bytes 1000 to 1999 of a document, the server response might look like:
HTTP/1.1 206 Partial Content
Content-Range: bytes 1000-1999/5000
[bytes 1000-1999 of the resource]
In this example,
/5000 indicates that the entire resource is 5000 bytes in length, and the server is returning bytes 1000 to 1999 as requested by the client.
It’s important to note that not all servers support partial content requests, and not all resources are available for partial content retrieval. If a server cannot or does not want to fulfill the range request, it can respond with the entire resource and a
200 OK status, or in some cases, it might respond with a
416 Range Not Satisfiable status if the requested range is invalid for the given resource.
What are HTTP status codes?
Published on: 2023-09-28
Updated on: 2024-01-10