问题描述
标题非常准确地说明了我的问题.如果我尝试使用 sharepoint 的 REST API 从列表中收集所有 400 多个项目,我只会得到前 100 个.
The title states my problem quite exactly. If I try to gather all 400+ items from a list using sharepoint's REST API, I only get first 100.
我已阅读http://msdn.microsoft.com/en-us/library/office/dn292552(v=office.15).aspx 和使用 REST 处理列表项"部分,他们说
I have read http://msdn.microsoft.com/en-us/library/office/dn292552(v=office.15).aspx and in the "Working with list items by using REST" part, they're stating that
以下示例展示了如何检索列表的所有项.
url: http://site url/_api/web/lists/GetByTitle(‘Test’)/items
方法:GET
标题:...
我已经突出显示了所有单词,因为那不是我得到的......
I have highlighted word all, because that's not what I'm getting ...
我错过了什么吗?是否有一些选项我应该禁用/启用以获取真正的所有项目?
Am I missing something? Is there some option I should disable/enable to gett truly all items?
谢谢
推荐答案
限制是由于服务器端分页.
The limitation is due to server side paging.
一种解决方法是一次检索 100 个项目,或者通过输入项目数量来覆盖限制:
A workaround is to retrieve 100 items at a time, or override the limitation by entering a count of items:
https://$DOMAIN/$SITE/_api/web/Lists/getByTitle('$LIST')/Items?$top=1000
请注意,5000 处也有一个阈值.
Note that there is also a threshold at 5000.
这篇关于Sharepoint 2013 REST API 未返回列表的所有项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!