2011-08-05 00:31:00 +08:00
|
|
|
Pagination
|
|
|
|
==========
|
|
|
|
|
|
|
|
Requests that return multiple items will be paginated to 10 items by default. Further pages
|
|
|
|
can be requested with the `?page` query parameter. You can set a custom per-page amount
|
2011-09-14 02:34:32 +08:00
|
|
|
with the `?per_page` parameter. There is an unspecified limit to how big you can set
|
|
|
|
`per_page` to, so be sure to always check for the `Link` header.
|
2011-08-05 00:31:00 +08:00
|
|
|
|
2011-09-14 02:34:32 +08:00
|
|
|
Pagination information is provided in the [Link header](http://www.w3.org/Protocols/9707-link-header.html):
|
2011-08-05 00:31:00 +08:00
|
|
|
|
2011-12-30 10:27:18 +08:00
|
|
|
Link: </courses/:id/discussion_topics.json?page=2&per_page=10>; rel="next",
|
|
|
|
</courses/:id/discussion_topics.json?page=1&per_page=10>; rel="first",
|
|
|
|
</courses/:id/discussion_topics.json?page=5&per_page=10>; rel="last"
|
2011-08-05 00:31:00 +08:00
|
|
|
|
|
|
|
The possible `rel` values are:
|
|
|
|
|
|
|
|
* next - link to the next page of results. None is sent if there is no next page.
|
|
|
|
* prev - link to the previous page of results. None is sent if there is no previous page.
|
|
|
|
* first - link to the first page of results. None is sent if there are no pages.
|
2012-04-18 06:07:45 +08:00
|
|
|
* last - link to the last page of results. None is sent if there are no pages, or if it
|
|
|
|
would be expensive to calculate the number of pages.
|