Download a verifiable byte pattern that supports HTTP Range requests
The byte at offset i is i % 256, so any slice can be checked. Single ranges such as bytes=0-99, bytes=500- and bytes=-10 return 206; unsatisfiable ranges return 416, and multiple ranges are ignored (full 200). A fixed ETag and Last-Modified make If-None-Match, If-Modified-Since and If-Range work. HEAD returns headers only.
Parameters 2
| Name | Type | Description |
|---|---|---|
nrequired | path · integer (int32) | Total size in bytes, 1–10485760 (10 MB). |
Range | header · string | Byte range, e.g. bytes=0-99. Returns 206, or 416 when unsatisfiable. |
Responses
- 200
- The full body.
- 206
- The requested range.
- 304
- Not modified (a conditional request matched).
- 400
- n is outside 1–10485760.
- 416
- The range is not satisfiable.
Example
Request
curl -X GET "https://api.testingapis.com/api/files/range/100" \
-H "Range: bytes=0-9" \
-H "X-TestingApis-Key: YOUR_API_KEY"Response206 Partial Content
Content-Type: application/octet-stream
ETag: "range-100"
Last-Modified: Tue, 01 Jul 2025 00:00:00 GMT
Content-Range: bytes 0-9/100
<binary body: 10 bytes, application/octet-stream>Sign in to see the details
The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.