The HTTP 206 status code stands for "Partial Content". It is a successful response indicating that the server is returning only a portion of the requested resource, as specified by the client’s Range header.
When is HTTP 206 Used?
- Used for resumable downloads, where a client requests a specific part of a file.
- Enables streaming media playback, allowing users to load only parts of a video/audio file.
- Used in large file transfers, reducing bandwidth by fetching only required segments.
Example Scenarios
- Resuming Downloads – A user pauses and resumes a file download.
- Streaming Video or Audio – A video player loads only the needed portion of a file.
- Efficient Data Retrieval – APIs return partial data for large datasets.
Example
Client Request (Requesting a File Range)
GET /video.mp4 HTTP/1.1
Host: example.com
Range: bytes=1000-5000
Server Response (Returning Partial Content)
HTTP/1.1 206 Partial Content
Content-Range: bytes 1000-5000/1000000
Content-Type: video/mp4
(binary data of the requested range...)
Summary
HTTP 206 means the server successfully returned part of the requested resource, often used for resumable downloads and media streaming to improve performance.