Skip to content
Myr

link docs!

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 3514816 · Browse files · 1 file+7 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−6 removed

  • other:+7 added−6 removed

1 file+7 added−6 removed

modified:docs/user/advanced.rst+7 added-6 removed
532 unmodified lines
533GitHub uses these for `pagination <http://developer.github.com/v3/#pagination>`_ in their API, for example::534535 >>> url = 'https://api.github.com/users/kennethreitz/repos?page=1&per_page=10'536 >>> r = requests.head(url=url)537 >>> print r.headers['link']538 ...539 'x-ratelimit-remaining': '4995'540 'x-ratelimit-limit': '5000'541 ...537 >>> r.headers['link']538 '<https://api.github.com/users/kennethreitz/repos?page=2&per_page=10>; rel="next", <https://api.github.com/users/kennethreitz/repos?page=6&per_page=10>; rel="last"'539543Requests will automatically parse these link headers and make them easily consumable:540Requests will automatically parse these link headers and make them easily consumable::541542 >>> r.links['next']543 'https://api.github.com/users/kennethreitz/repos?page=2&per_page=10'544545 >>> r.links['last']546 'https://api.github.com/users/kennethreitz/repos?page=6&per_page=10'547