问题
I have read the document of office 365 about onedrive. I have send two http requests:
1)https://graph.microsoft.com/v1.0/me/drive/root/children?$orderby=name&$top=5&$skip=0
2)https://graph.microsoft.com/v1.0/me/drive/root/children?$orderby=name&$top=5&$skip=5
but I have received the same result,anyone could tell me whether office 365 onedrive supports paging?
回答1:
OneDrive's paging model is a little different to skip+take. Essentially you'll make a query like:
GET https://graph.microsoft.com/v1.0/me/drive/root/children?$top=5
and in the response you should see the usual array of values, along with a property called @odata.nextLink. You'll want to take that URL use it request the next page:
"@odata.nextLink": "https://graph.microsoft.com/v1.0/me/drive/root/children?$skiptoken=ASDGASGSD"
GET https://graph.microsoft.com/v1.0/me/drive/root/children?$skiptoken=ASDGASGSD
You keep doing this until you don't get an @odata.nextLink returned.
来源:https://stackoverflow.com/questions/35715726/office-365-onedrive-does-not-support-paging