Google Photos API, pageSize Parameter not returning expected results

时光毁灭记忆、已成空白 提交于 2019-12-06 03:33:41

问题


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

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

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

Thanks


回答1:


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

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.)



来源:https://stackoverflow.com/questions/50984908/google-photos-api-pagesize-parameter-not-returning-expected-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!