You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: