Rest API - Pagination Patterns
You have an API that returns data with cursor-based pagination. The API returns the following responses in sequence:
1. {"data": ["a", "b"], "next_cursor": "c1"}
2. {"data": ["c", "d"], "next_cursor": "c2"}
3. {"data": ["e"], "next_cursor": null}You want to collect all items without duplicates even if the API sometimes returns overlapping data due to data changes. Which approach is best?
