Pagination with Limit and Offset is commonly used to return large data sets from an API.
When an API request contains Limit and Offset values, should the response body also include the same Limit and Offset values or are those fields redundant and unnecessary in response?
Many examples show Limit and Offset included in the response body. Is this best practice and for what purpose if the requester already has this information?
Example Request: baseUrl.com/api/data?limit=50&offset=100
Example Response:
{
"totalResults": 100000,
"limit": 50, // is this best practice or redundant?
"offset": 100, // is this best practice or redundant?
"count": 50,
"items": [ ]
}