[google document api分页

问题描述 投票:1回答:1

我正在使用Google文档API。我需要实现分页。

我如下使用。

第一页:

qry.setMaxResults(10);
qry.setStartIndex(1);

第二页:

qry.setMaxResults(10);
qry.setStartIndex(11);

第二页我也得到相同的10条结果。

[This问题以this作为答案链接。

我在此链接中找不到任何答案。谁能帮我?在此先感谢..

google-drive-api google-docs-api
1个回答
3
投票

文档列表API使用“下一个”标记进行分页,而不使用起始索引:

https://developers.google.com/google-apps/documents-list/#getting_all_pages_of_documents_and_files

要检索文档的所有页面,请从头开始,然后单击带有rel=next的链接以获得更多页面。

最大结果参数用于限制每页中的元素数。

请记住,您可以(并且应该)也使用较新的Drive API来执行相同的任务:

https://developers.google.com/drive/v2/reference/files/list

© www.soinside.com 2019 - 2024. All rights reserved.