Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

When use api/v4, will only get the last 20 records #21

Open
Open
When use api/v4, will only get the last 20 records#21

Description

After check the code, I found the header of api/v4 has not contains "X-Total-Pages", so we cannot get the total page. The "X-Next-Page" is a good solution, if the records are read to end, this attribute will empty.

params = {'page': 1}
resp = request(url, params)
for row in resp.json():
yield row
next_page_s = resp.headers.get('X-Next-Page', 1)
while len(next_page_s) != 0:
next_page_i = int(next_page_s)
params['page'] = next_page_i
resp = request(url, params)
next_page_s = resp.headers.get('X-Next-Page', 1)
for row in resp.json():
yield row

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions