question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

expose additional header values to the user in v3 API

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dhruvmanilacommented, Nov 14, 2020

@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 GET /repos/:owner/:repo endpoint and the open_issues_count attribute will give you that.

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 total_count which provides the count of your match.

Search API: https://docs.github.com/en/free-pro-team@latest/rest/reference/search Search qualifiers (conditions): https://docs.github.com/en/free-pro-team@latest/github/searching-for-information-on-github/searching-on-github

0reactions
boralylcommented, Nov 15, 2020

@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 GET /repos/:owner/:repo endpoint and the open_issues_count attribute will give you that.

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 total_count which provides the count of your match.

Search API: https://docs.github.com/en/free-pro-team@latest/rest/reference/search Search qualifiers (conditions): https://docs.github.com/en/free-pro-team@latest/github/searching-for-information-on-github/searching-on-github

Thanks for pointing these out, this does make things a little bit easier. One thing to note is that the open_issues_count includes all issues and pull requests, so you will need to subtract the pull requests to get the actual number open “issues”. For my use case this call worked to retrieve open pull requests: https://api.github.com/search/issues?q=repo:home-assistant/core+state:open+is:pr"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access-Control-Expose-Headers - HTTP - MDN Web Docs
The Access-Control-Expose-Headers response header allows a server to indicate which response headers should be made available to scripts ...
Read more >
How to send custom headers with requests in Swagger UI?
You can add a header parameter to your request, and Swagger-UI will show it as an editable text box: swagger: "2.0" info: version:...
Read more >
Pass custom headers through API Gateway to a Lambda ...
Create a Lambda function to handle custom headers from your API Gateway API · 1. Open the Lambda console. · 2. Choose Create...
Read more >
Using Axios to set request headers - LogRocket Blog
Let's explore the different ways we can use Axios to set request headers for API calls: Passing an object argument; Creating a specific...
Read more >
HttpHeaders (Spring Framework 6.0.3 API)
The CORS Access-Control-Expose-Headers response header field name. static final String ... Add the given, single header value under the given name.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found