codeimag.es
codeimag.es copied to clipboard
improper return code (400) when exceeding rate limit
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