Pagination: Difference between revisions

Jump to navigation Jump to search
4 bytes removed ,  14 January 2021
no edit summary
(Created page with "When APIs need to return a lot of data or if computing which items to show is expensive it is useful to return data in a page-wise fashion. If the response size is less than...")
 
No edit summary
Line 10: Line 10:
If there is more data than fits on the first page, the [[URL]] for the next page should be set using a [[Link Header]] with `rel=next`.
If there is more data than fits on the first page, the [[URL]] for the next page should be set using a [[Link Header]] with `rel=next`.


For subsequent pages, if the resource supports iterating backwards, a [[Link Header]] with `rel=prev` should be added as well.
For subsequent pages, if the resource supports iterating backwards, a Link Header with `rel=prev` should be added as well.


If you want to support going to the first and last pages, those can be indicated with `rel=first` and `rel=last`.
If you want to support going to the first and last pages, those can be indicated with `rel=first` and `rel=last`.

Navigation menu