Extend Rate
and Rate Limiting with X-Ratelimit-Used
and X-Ratelimit-Resource
headers
#3453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GitHub introduced two new headrs when it comes to rate limiting:
X-Ratelimit-Used
X-Ratelimit-Resource
See https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit
For which resources are available, see https://docs.github.com/en/rest/rate-limit/rate-limit?apiVersion=2022-11-28#get-rate-limit-status-for-the-authenticated-user
This Pull Request extends the Rate Limiting Header parsing and adds the two new information into the
Rate
response.Additionally, the key
used
is added into the response from the/rate_limit
API endpoint.For the
Rate
type, the docs have been updated according to the original GitHub API docs.