Github v3 API可以让所有组织超过100个 [英] Github v3 API get all organizations more than 100
问题描述
我试图通过 http:// host / api / v3 / organizations?page = 2& per_page = 100
默认大小看起来像是30,而100似乎是每个请求的最大限制。
但上面的链接仍然只返回前100个项目,即不是101-200th
我也试过http:host // api / v3 / organizations? page = 2
无论我设置了哪个页面,它只返回前30个项目。
我怎样才能得到整个组织项目清单?请帮忙。欣赏。 组织rel =nofollow noreferrer>针对上市组织的Github API参考:
$ b
注意:分页由因为参数。使用
链接标题获取下一页的URL例如,使用 curl :curl -Ihttps://api.github.com/organizations
给出以下链接标题:
链接:< https://api.github.com/organizations?since = 3043>; rel =next,< https://api.github.com/organizations {?since}>; rel =first
所以下一页将会是 https://api.github.com/organizations?since=3043
对于每一个请求,你都会检查这个头部来获得下一个url到$ /
I am trying to get all organization items through http://host/api/v3/organizations?page=2&per_page=100
The default size seems like 30, and 100 seems like the max limit per request. But above link still only returns the first 100 items, i.e, not 101-200th
I also tried http:host//api/v3/organizations?page=2 No matter which page I set, it only returns the first 30 items.
How can I get the entire list of organization items please? Please help. Appreciate.
解决方案From Github API reference for listing organizations :
Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of organizations.
For instance checking the 2nd page using curl :
curl -I "https://api.github.com/organizations"
gives the following link header :
Link: <https://api.github.com/organizations?since=3043>; rel="next", <https://api.github.com/organizations{?since}>; rel="first"
So the next page will be https://api.github.com/organizations?since=3043
For each request you would check this header to get the next url to hit
这篇关于Github v3 API可以让所有组织超过100个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!