我正在检索用户的联系人组。我必须通过分页来展示小组。 所以我这样做,
URL feedUrl1 = new URL("https://www.google.com/m8/feeds/groups/"+userEmail+
"/full/?xoauth_requestor_id"+userEmail+"&start-index=10&max-results=5");
ContactGroupFeed resultFeed1 = contactService.getFeed(myQuery, ContactGroupFeed.class);
以上查询显示从10开始并显示所有记录的结果。
它不会根据max-results
检索结果。
它有什么问题吗?对我来说另一个选择是什么?
答案 0 :(得分:2)
我做了一个快速测试,max-results参数按预期工作。
我共有6个联络小组。快乐1,快乐2,快乐3,快乐4,快乐5和快乐6。
这是我提出的要求:
https://www.google.com/m8/feeds/groups/userEmail/full?start-index=1&max-results=5
在回复中,我得到参数<openSearch:itemsPerPage>5</openSearch:itemsPerPage>
,结果只显示Happy 1 - 5。
我认为如果您使用的是oauth_requestor_id,则网址应如下所示:
https://www.google.com/m8/feeds/groups/userEmail/full?xoauth_requestor_id=userEmail&start-index=10&max-results=5