HTTP 416 Range Not Satisfiable vs 429 Too Many Requests
Both HTTP 416 (Range Not Satisfiable) and 429 (Too Many Requests) 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, 429 means that the user has sent too many requests in a given time (rate limiting). The response should include a Retry-After header.
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 user has sent too many requests in a given time (rate limiting). The response should include a Retry-After header.
When You See It
When hitting API rate limits or making too many requests too quickly.
How to Fix
Check the Retry-After header. Implement exponential backoff. Consider caching responses.
Key Differences
HTTP 416: The server cannot serve the requested byte range. The Range header value is outside the resource's size.
HTTP 429: The user has sent too many requests in a given time (rate limiting). The response should include a Retry-After header.
You encounter 416 when when requesting a byte range beyond the file's actual size.
You encounter 429 when when hitting API rate limits or making too many requests too quickly.
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 429 (Too Many Requests): Check the Retry-After header. Implement exponential backoff. Consider caching responses.