We are now designing our RESTful API and I have a question for how to expose the pagination information.
It seems some famous services like Github or Firefox Market Place having something like below in their API:
{ "meta": { "limit": 3, "next": "/api/v1/apps/category/?limit=3&offset=6", "offset": 3, "previous": "/api/v1/apps/category/?limit=3&offset=0", "total_count": 16 } } My question is:
Why should the server give the complete next/previous url in the response?
It seem to me that the client is making the first request. So it knows what parameters it used to call (offset/limit/api version). It is easy for the client to figure out what is the next/previous url to call. Why bother to calculate the redundant urls and give it to the client?