Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用API在我的Bitbucket存储库中获取我的所有问题_Java_Bitbucket_Bitbucket Server_Bitbucket Api - Fatal编程技术网

Java 如何使用API在我的Bitbucket存储库中获取我的所有问题

Java 如何使用API在我的Bitbucket存储库中获取我的所有问题,java,bitbucket,bitbucket-server,bitbucket-api,Java,Bitbucket,Bitbucket Server,Bitbucket Api,我正在使用Java,并通过Unirest.get(参见下面的代码)发出了get请求 代码运行得很好,但我有一个大问题:我没有得到我所有的问题,只有20个 你能告诉我为什么我没有全部拿到吗 String json = new Gson().toJson(Unirest.get("https://api.bitbucket.org/2.0/repositories/{username}/{repo_slug}/issues") .header("Authorization",

我正在使用Java,并通过
Unirest.get
(参见下面的代码)发出了get请求

代码运行得很好,但我有一个大问题:我没有得到我所有的问题,只有20个

你能告诉我为什么我没有全部拿到吗

String json = new Gson().toJson(Unirest.get("https://api.bitbucket.org/2.0/repositories/{username}/{repo_slug}/issues")
            .header("Authorization", "Basic " + encoded)
            .header("Content-Type", "application/json; charset=UTF-8")
            .header("Accept", "application/json; charset=UTF-8")
            .asJson());
System.out.println(json);
当我在.json文件中复制输出时,我没有得到我预期的所有问题。

说明有一个参数
pagelen
具有以下描述:

现有页面上的当前对象数。默认值为 10最大允许值为100。个别空气污染指数可 强制执行不同的值

因此,似乎正在进行分页,您可以将此
pagelen
设置为更大,也可以获取
next
属性,该属性是对象下一页的URI,并以这种方式加载其余对象

pagelen
为100的url示例:


您的问题中可能包含(部分)响应负载?有传呼吗?或者检查文档,如果有一个请求参数来指定响应大小或页码?Api说,如果我发出此get请求,我将在我的问题跟踪器中获取所有问题,而不编辑参数。如果我使用一个查询字符串并按特定问题进行筛选,我会得到这个问题,但是当我执行代码时,这个问题不在json输出中。我还试着设置了一个限制,但不可行。你是对的,有了分页,代码就可以正常工作了。谢谢:)
https://api.bitbucket.org/2.0/repositories/{username}/{repo_slug}/issues?pagelen=100