HTTP 416 Range Not Satisfiable vs 428 Precondition Required
Both HTTP 416 (Range Not Satisfiable) and 428 (Precondition Required) belong to the 4xx Client Error category. 416 indicates that the server cannot serve the requested byte range. The Range header value is outside the resource's size. Meanwhile, 428 means that the server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.
Description
The server cannot serve the requested byte range. The Range header value is outside the resource's size.
When You See It
When requesting a byte range beyond the file's actual size.
How to Fix
Check the Content-Range in the response for the actual file size and adjust your Range header.
Description
The server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.
When You See It
When an API requires optimistic concurrency control via ETags.
How to Fix
Fetch the resource first to get its ETag, then include If-Match in your update request.
Key Differences
HTTP 416: The server cannot serve the requested byte range. The Range header value is outside the resource's size.
HTTP 428: The server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.
You encounter 416 when when requesting a byte range beyond the file's actual size.
You encounter 428 when when an API requires optimistic concurrency control via ETags.
When to Use Which
For 416 (Range Not Satisfiable): Check the Content-Range in the response for the actual file size and adjust your Range header. For 428 (Precondition Required): Fetch the resource first to get its ETag, then include If-Match in your update request.