Код: Выделить всё
],
"paging": {
"next": {
"after": "2459708154",
"link": "https://api.someapi.com/objects?archived=false&limit=100&after=2459708154
},
"prev": null
}
В настоящее время я делаю это, используя несколько операторов If и извлекая данные только до 300-400 записей, как показано ниже;
Код: Выделить всё
var recentDealsInfo = await _objReq.Post(_limit, dtPastDay, isGetRecentAPI: true);
//store response in a list of deals
List lstRecentDeals = recentDealsInfo.results;
//handle paging for more than 100 records
if (!string.IsNullOrEmpty(recentDealsInfo.paging.next.after))
{
//build request url using paging information for next 100 records
var nxtdeals = await _objReq.Post(_limit, dtPastDay, nxtLink: recentDealsInfo.paging.next.after, isGetRecentAPI: true);
//add records to the list
lstRecentDeals.AddRange(nxtdeals.results);
if (!string.IsNullOrEmpty(nxtdeals.paging.next.after))
{
//build request url using paging information for next 100 records
var nextdeals = await _objReq.Post(_limit, dtPastDay, nxtLink: nxtdeals.paging.next.after, isGetRecentAPI: true);
//add records to the list
lstRecentDeals.AddRange(nextdeals.results);
if (!string.IsNullOrEmpty(nextdeals.paging.next.after))
{
//build request url using paging information for next 100 records
var nextdeal = await _objReq.Post(_limit, dtPastDay, nxtLink: nextdeals.paging.next.after, isGetRecentAPI: true);
//add records to the list
lstRecentDeals.AddRange(nextdeal.results);
}
// and so on ....
}
}
Подробнее здесь: https://stackoverflow.com/questions/638 ... equirement