codeimag.es icon indicating copy to clipboard operation
codeimag.es copied to clipboard

improper return code (400) when exceeding rate limit

Open bbelderbos opened this issue 2 years ago • 0 comments

When a client exceeds the rate limit, the API may respond with an error code (such as 429 - Too Many Requests) or temporarily block further requests until the rate limit resets. Some APIs may provide additional information in the response headers, indicating the remaining limit and the time when the limit will reset.

https://github.com/bbelderbos/codeimag.es/blob/main/tips/main.py#L134 -> better to return 429 instead of 400

bbelderbos avatar May 25 '23 08:05 bbelderbos