This server error response code indicates that the byte range specified in the client’s request cannot be fulfilled.
Meaning
The server is unable to satisfy the requested byte range. This typically occurs when the client requests a part of a file (using a range request), but the requested range exceeds the actual size of the file.
Use Cases
- Resuming Downloads: When the client attempts to resume a partially downloaded file, but the requested range is no longer valid.
- Video Streaming: When requesting a specific time segment while playing a video, but that segment does not exist.
Example
Assuming a file size of 1000 bytes, if the client requests the range 2000-3000 bytes, the server will return a 416 status code.
Server Response
The server usually includes a Content-Range
header in the response to indicate the actual size of the resource. For example:
HTTP/1.1 416 Range Not Satisfiable
Content-Range: bytes */1000
Client Handling
Upon receiving a 416 response, the client should reassess its requested range, potentially re-requesting the entire resource or adjusting the range.
Preventive Measures
Developers should ensure that the client validates the current size of the resource before sending a range request, especially when dealing with dynamic content that may change.
To avoid this error, the client should first retrieve the total size of the resource (which can be done using a HEAD request) before sending a range request.
Related 4xx error code
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Payload Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 417 Expectation Failed
- 418 I’m a teapot
- 421 Misdirected Request
- 422 Unprocessable Entity (WebDAV)
- 423 Locked (WebDAV)
- 424 Failed Dependency (WebDAV)
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 499 Client Closed Request