-
Notifications
You must be signed in to change notification settings - Fork 3
Paged Result
Typically when a Web API method has the potential for returning very large lists of objects, it uses a paging metaphor to limit the number of responses returned in a single request. This helps keep the Web API performant and allows consuming applications to tune the size of their requests according to how the data will be displayed and/or used.
Such methods typically take two extra Query String parameters so that the caller can control which page of results the API should return:
Skip - The number of records to skip past. Default is 0.
Take - The number of records to return. Default varies and the maximum value is typically 500.
The response body will contain two properties:
Items - An array of the objects that make up this page of the data.
More - A boolean flag indicating whether there are further pages of data available.
Eg:
{
Items: [
{ ... Result 1 ... },
{ ... Result 2 ... },
],
More: true
}To move to the next page of data, increment Skip by Items.length. Eg:
Skip+=repsonse.Items.length;