当我从 github 用户中获取用户时,有没有办法限制为 100 个用户?

Is there a way to Limit to 100 users when I get users form github users?

我正在改装:

https://api.github.com/users

我想知道如何限制 100 个用户?

可以使用per_page参数:

https://api.github.com/users?per_page=100

然后检查 Link headers 响应并检查 rel="next" link,它应该包含您设置最后一个的 since 参数您在上次通话中获得的 ID:

https://api.github.com/users?per_page=100&since=135

尽管 100 似乎是它所说的默认值:

You can specify how many items to receive (up to a maximum of 100);

查看其文档:https://developer.github.com/v3/guides/traversing-with-pagination/#changing-the-number-of-items-received