Re:Paginating Requests in APIs (2020)
by mypalmike on Saturday May 28, 2022 @02:18PM
(#31542486)
With opaque cursors, how does a client specify "a desired amount"?
[ Parent
| on HN ]
You just say "this cursor + 5 pages", for example.
Re:Paginating Requests in APIs (2020)
by hombre_fatal on Saturday May 28, 2022 @03:06PM
(#31542820)
You send `GET /items[?cursor=<cursor>]` to my server.
I respond:
[
"items": [ {...}, {...}, {...}, ... ],
"next_cursor": "77963b7a"
]
How do you request "this cursor + 5 pages"?GET /items?cursor=77963b7a&add_to_cursor=5pages
Re:Paginating Requests in APIs (2020)
by ignaciochiazzo on Tuesday May 31, 2022 @11:42PM
(#31577792)
I strongly suggest not doing this since the application will be implementing `offset` in that scenario. This is the same as having Page-based pagination but with a cursor that acts a filter/sorting blob.