Add Retry-After header when a rate limit has been triggered
Open, Needs TriagePublic

Description

When using a bot if a rate limit is triggered there is no programmatic way I could found to know how many time I should wait to retry and continue with the task. Would it be possible to add a Retry-After header in this cases with the amount of time the bot should wait before retrying the request?

Additionally, it would be nice if the response status would indicate that the operation wasn't completed successfully not using the 200 OK status code. Semantically the most appropriate one would probably be 429 Too many requests, which based on the RFC 6585 may use the Retry-After header.

Agabi10 created this task.Aug 2 2017, 3:25 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 2 2017, 3:25 PM
Anomie added a subscriber: Anomie.Aug 2 2017, 10:22 PM

When using a bot if a rate limit is triggered there is no programmatic way I could found to know how many time I should wait to retry and continue with the task. Would it be possible to add a Retry-After header in this cases with the amount of time the bot should wait before retrying the request?

The underlying code typically used for rate limits doesn't return any "time to wait" information, so that would need to be changed first before the API could indicate it.

Additionally, it would be nice if the response status would indicate that the operation wasn't completed successfully not using the 200 OK status code.

The API basically uses HTTP as a transport, returning errors at its own layer rather than the transport layer. See T40716: API should use status codes for errors for more.

Anomie moved this task from Unsorted to Blocked on the MediaWiki-API board.Aug 2 2017, 10:22 PM