Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.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
如何在API url中增加值_Api_Limit_Offset - Fatal编程技术网

如何在API url中增加值

如何在API url中增加值,api,limit,offset,Api,Limit,Offset,我有一个带有偏移值和限制值的API 字符串requestUrl=; 这将获取前1000个详细信息。 我需要更多的细节,为此我需要多次发送API。 比如说,我需要执行这个API 5次,偏移值应该第一次更改为1001,限制为2001 我们如何在java中的通用方法中实现这一点。我不明白您的问题出在哪里,您只需要这样做: x = 1000; x += 1000; url = "https://url?offsetStart=" + (x - 1000) + "&offsetEnd=" + x;

我有一个带有偏移值和限制值的API 字符串requestUrl=; 这将获取前1000个详细信息。 我需要更多的细节,为此我需要多次发送API。 比如说,我需要执行这个API 5次,偏移值应该第一次更改为1001,限制为2001
我们如何在java中的通用方法中实现这一点。

我不明白您的问题出在哪里,您只需要这样做:

x = 1000;
x += 1000;
url = "https://url?offsetStart=" + (x - 1000) + "&offsetEnd=" + x;
对于一个API,你可以有两个相同的参数,比如“offset”,试试“offsetStart”和“offsetEnd”