-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose additional header values to the user in v3 API #110
Comments
How would you want that exposed in the API? |
I'm not sure what the API would look like, but I also have a situation where having access to the response headers would be useful. In my case I want to get the total count of issues and pulls. Technically this is possible doing: issues_data = [
issue
async for issue in github.getiter(
issues_url, {"state": "open", "sort": "created"}
)
]
total_issues = len(issues_data) However this requires making If I had access to the response headers I could specify 1 result per page when requesting the issues url and look at the
|
@boralyl Hey, if you want to get the total number of issues and pull requests in a repository, you can get it in one call to Also, if you want only the pull requests count or the issue count you should use the search API. You can include a variety of conditions and there's an attribute Search API: https://docs.github.com/en/free-pro-team@latest/rest/reference/search |
There's this case as well where you want to download the logs for a workflow run or job: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#download-workflow-run-logs. Here, we get the log file download link in |
Thanks for pointing these out, this does make things a little bit easier. One thing to note is that the |
Some of the API end points in the v3 API (well, at least one https://developer.github.com/v3/activity/notifications/) add the field
'X-Poll-Interval'
to the response header which they request users respect.It looks like the headers are available in
_make_request
, but are dropped on the floor after extracting the cache-related and next page data.The text was updated successfully, but these errors were encountered: