Friday - last edited Friday
I have an issue with an infinite loop in pagination. API Server returns a next URI which matches the previous URI. It can happen on any pages. For example, HTTP client fetched 10 pages but the page 10 contains the next URI which matches the previous URI. I want to stop in order to avoid an infinite loop but I don't know how get the previous URI in Pagination section. Do you have any ideas how to do it?
For example, URI request = https://hostname.com/?after=bbbb returns:
{
"entity": {
"data": [],
"paging": {
"next": "https://hostname.com/?after=bbbb",
"previous": "https://hostname.com/?before=aaaa"
}
}