Google Photos API的pageSize参数未返回预期结果 [英] Google Photos API, pageSize Parameter not returning expected results

查看:113
本文介绍了Google Photos API的pageSize参数未返回预期结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google Photos API Explorer,我试图限制使用albums.list方法返回的相册数量.

Using the Google Photos API Explorer I am trying to limit the number of albums returned using the albums.list method.

如果我将pageSize设置为10,则api资源管理器会返回5个相册,如果我将其设置为3,则会返回1个相册.

If I set pageSize = 10, the api explorer returns 5 albums, if I set it to 3 in returns 1 album.

关于为什么我没有在响应中看到与通过pageSize参数设置的相册数量相同的任何建议吗?

Any suggestions as to why I am not seeing the same number of albums in the response as is set via the pageSize parameter?

谢谢

推荐答案

页面大小描述了所需的最大结果数,但不能保证.

The page size describes the desired maximum number of results, but it is no guarantee.

如果单个请求至少需要10个结果,则最好的选择是请求更大的页面大小.另外,您始终可以使用nextPageToken发出其他请求.

If you need at least 10 results from a single request, your best option would be to request a higher page size as you have found. Alternatively, you can always make additional requests using the nextPageToken.

(我们有一些计划,将来会对此进行改进,并返回等于或接近页面大小的结果数量.遗憾的是,目前我们不能保证请求中的结果数量,但是我们总是尽可能地填充页面大小.)

(We have some plans to improve this in the future and return a number of results that's equal, or even closer, to the page size. Unfortunately, at the moment we can't guarantee the number of results in a request, but we always try to fill a page size if possible.)

这篇关于Google Photos API的pageSize参数未返回预期结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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