使用Google Drive API v2澄清maxResults和nextPageToken [英] Clarification on maxResults and nextPageToken using Google Drive API v2

查看:585
本文介绍了使用Google Drive API v2澄清maxResults和nextPageToken的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想澄清一下Google Drive API中的文件:列表功能:

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

maxResults可指定的最大值是多少?我假设这个值计算结果的下一页的结果数量?



另外,nextPageToken是查询字符串的一部分,需要通过nextLink传递给查询字符串获得下一页结果?



谢谢! maxResults 查询参数可用于限制(或增加)列表请求中返回的项目数。有一个默认值和我们的服务器设置的硬限制。
不幸的是,我们通常不会记录这些数字,因为它们可以轻松更改,并推荐开发人员查找 nextPageToken 和/或 nextLink 在结果集合中,以知道是否已返回所有项目。



nextPageToken 属性将用作列表请求中的 pageToken 查询参数。如果您使用结果集合中的 nextLink ,则不需要指定 pageToken 查询参数,因为它应该已经包括在内。


I just wanted clarification with regard to the Files: list feature of the Google Drive API here:

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

What is the the maximum value that can be specified with maxResults? I assume this value calculates the number of results on the next page of results?

Also, is the nextPageToken simply part of the query string that's required to be passed with nextLink to get the next page of results?

Thanks!

解决方案

The maxResults query parameter can be used to limit (or increase) the number of items returned in a list request. There is a default value and a hard limit that is set by our server. Unfortunately, we don't usually document those numbers as they can easily change and recommend developers to look for a nextPageToken and/or nextLink in the resulting collection to know whether or not all items have been returned.

The nextPageToken attribute is to be used as the pageToken query parameter on a list request. If you are using the nextLink from the resulting collection, you do not need to specify the pageToken query parameter as it should already be included.

这篇关于使用Google Drive API v2澄清maxResults和nextPageToken的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆