Reports the current rate limit status for the authenticated user, either pulls this information from a previous successful request or directly from the GitHub API.
Arguments
- response
gh_response
object from a previousgh
call, rate limit values are determined from values in the response header. Optional argument, if missing a call to "GET /rate_limit" will be made.- .token
Authentication token. Defaults to
GITHUB_PAT
orGITHUB_TOKEN
environment variables, in this order if any is set. Seegh_token()
if you need more flexibility, e.g. different tokens for different GitHub Enterprise deployments.- .api_url
Github API url (default: https://api.github.com). Used if
endpoint
just contains a path. Defaults toGITHUB_API_URL
environment variable if set.- .send_headers
Named character vector of header field values (except
Authorization
, which is handled via.token
). This can be used to override or augment the defaultUser-Agent
header:"https://github.com/r-lib/gh"
.
Details
Further details on GitHub's API rate limit policies are available at https://docs.github.com/v3/#rate-limiting.