如何从InstaSharp中的Relationships端点访问UsersResponse中的分页?

我有一个InstaSharp.Endpoints.Relationships.Authenticated对象EP_RELATIONSHIPS ,我可以调用EP_RELATIONSHIPS.Follows()来获取我正在关注的用户列表。 我跟随几百人,但我只得到了50的结果。

当我使用API​​控制台检查Instagram API页面上的JSON数据时,我可以看到有一个分页URL。

其他返回对象(如InstaSharp.Model.Responses.MediasResponse有一个名为.Pagination的对象,它似乎提供此function。

这个图书馆不完整吗? 为什么在Relationships端点响应中没有分页,如何在不重写我自己的InstaSharp这部分版本的情况下完成分页?

最新版本的Instasharp( https://github.com/InstaSharp/InstaSharp )在课堂上具有’Pagination’属性。

还有一个分页实现用于在Tags.RecentMultiplePages(..)方法中返回库中的多个页面集,该方法将来可以更通用并推广到多个方法。

您可以创建自己的具有分页的对象 – > next_url | next_cursor。 从响应中获取json并将其反序列化为您自己的对象。

为了进一步阐明Damian的答案 ,如果你看一下InstaSharp github上的unit testing,你可以看到一个如何使用Pagination的例子:

  public async Task Follows_NextCursor() { //This test will fail if testing with an account with less than one page of follows var result = await relationships.Follows(); result = await relationships.Follows(457273003/*ffujiy*/, result.Pagination.NextCursor); Assert.IsTrue(result.Data.Count > 0); }