# 206 Partial Content

> https://http-status.org/docs/206

**Family:** 2xx Success

## Rationale

Sent in response to a valid Range request; body contains one or more requested ranges.

## In Plain Terms

You asked for just a piece of a file (like pages 5-10 of a book), and here's that specific piece you wanted!

## Description

The HTTP 206 Partial Content status code indicates that the server is successfully fulfilling a range request for the target resource by transferring one or more parts of the selected representation. Single-part responses must include a Content-Range header, while multipart responses use multipart/byteranges with range metadata in each body part.

## Server Perspective

### Usage
- Return 206 for resumable downloads, media seeking, and partial fetches
- Use it only when the request included a satisfiable range
- Video/audio streaming with range requests
- Large file downloads that support resume functionality
- PDF page range requests
- Image tile serving for maps or large images
- Any scenario where clients request specific byte ranges

### Implementation
- Include Content-Range for single-range responses
- Use multipart/byteranges when returning multiple ranges
- Do not send a top-level Content-Range header on multipart responses; each body part carries its own Content-Range

### Common Headers
- Content-Range
- Accept-Ranges
- Content-Type
- If-Range — sent by the client to make the range request conditional; validate it before responding with 206 to avoid delivering partial content from a stale representation.

### Body
- Return the requested range bytes, or multipart body parts for multiple ranges

### Pitfalls
- Do not use 206 when the client did not ask for a range
- Return 416 instead when the requested range cannot be satisfied
- Do not send a top-level Content-Range header together with a multipart/byteranges response
- When no Range header was provided (use 200 OK)
- When the Range request is invalid (use 416 Range Not Satisfiable)
- For small files where partial content doesn't make sense
- When the server doesn't support range requests

## Client Perspective

### Pitfalls
- Do not treat 206 as if it were the full representation unless the requested range covered the whole thing

## Examples

### Video streaming

The server returns only the requested portion of the file instead of the entire video.

**Request:**
```
GET https://api.example.test/video.mp4
Range: bytes=1000000-2000000
```

**Response:**
```
206 Partial Content
Content-Range: bytes 1000000-2000000/50000000

<partial representation>
```

### Resume file download

The client resumes a download from byte 5 MB instead of starting the transfer over.

**Request:**
```
GET https://api.example.test/largefile.zip
Range: bytes=5242880-
```

**Response:**
```
206 Partial Content
Content-Range: bytes 5242880-10485759/10485760

<partial representation>
```

## Related Codes

- [200 OK](/docs/200.md)
- [416 Range Not Satisfiable](/docs/416.md)

