When you see this status
- Client sends Range header requesting specific byte ranges
- Server supports range requests and resource is large
- Client uses HTTP/1.1 with partial content support
- Server splits response into multiple parts for streaming
Common causes
- Client explicitly requests partial content via Range header
- Server implements HTTP/1.1 range requests
- Resource is large and supports byte-range requests
- Client uses Accept-Ranges header in request
How to debug it
- Verify Range header format in client request
- Check server logs for range request handling
- Ensure Content-Range header is present in response
- Validate Content-Length matches requested range
- Test with tools like curl using -r flag
Return this code in your framework
Express (Node.js)
res.status(206).set('Content-Range', 'bytes 0-99/1000').send(data.slice(0, 100));
FastAPI (Python)
return Response(content=data[0:100], status_code=206, headers={"Content-Range": "bytes 0-99/1000"})
NestJS
@Get() getPartial(@Res() res: Response) { res.status(206).set('Content-Range', 'bytes 0-99/1000').send(data.slice(0, 100)); }
Go (net/http)
w.WriteHeader(http.StatusPartialContent); w.Header().Set("Content-Range", "bytes 0-99/1000"); w.Write(data[0:100])
About HTTP 206
HTTP status code 206 Partial Content is part of the
2xx Success family. Server successfully fulfills a range request for part of a resource. Understanding it is essential for
backend engineers, API designers, and anyone debugging integrations between services.
The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance:
what triggers them, how to debug them in production, and exactly how to return them from common
frameworks. Each code page is hand-curated and verified.