206 Partial Content
The server is sending only part of the file: the byte range the client asked for in its Range header.
What 206 Partial Content means
Clients send a Range header (for example Range: bytes=0-1023) to get part of a resource. The server replies 206 with a Content-Range header saying which bytes are in the body and the full size, like Content-Range: bytes 0-1023/146515.
This is how video players seek and how download managers resume broken downloads. If the client asks for several ranges, the server can send them in a multipart/byteranges body.
A range outside the file gets 416. A server that does not support ranges ignores the header and sends the whole file with 200. Servers advertise support with Accept-Ranges: bytes.
Headers that go with it
RangeContent-RangeAccept-RangesIf-Range
Example response
HTTP/1.1 206 Partial Content
Content-Range: bytes 0-1023/4096
Content-Type: text/plain; charset=utf-8
206 Partial ContentHow to check for a 206 response
cURL
# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/JavaScript (Node.js)
const res = await fetch("https://example.com/");
if (res.status === 206) {
console.log(res.status, res.statusText);
}Python
import requests
res = requests.get("https://example.com/")
if res.status_code == 206:
print(res.status_code, res.reason)Go
res, err := http.Get("https://example.com/")
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 206 {
fmt.Println(res.Status)
}Specification
206 Partial Content is defined in RFC 9110, section 15.3.7.
Related status codes
- 416
The byte range asked for in the Range header is outside the file, so the server cannot send that part.
- 200
The request worked. The response body holds the result, such as the page, file or JSON data the client asked for.
- 304
The cached copy is still valid, so the server sends no body and the client loads the resource from its own cache.