With opaque cursors, how does a client specify "a desired amount"?
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.
Re:Paginating Requests in APIs (2020)
by dingleberry420 on Saturday May 28, 2022 @01:48PM
(#31542268)
If the server supports this, which they won't, because they don't want to support pagination.
Huh? The client can ask the server to generate a new cursor, any desired amount of items ahead in the list.