Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/383.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 android AsyncHttpClient发送带有标头和参数的get请求_Java_Android - Fatal编程技术网

java android AsyncHttpClient发送带有标头和参数的get请求

java android AsyncHttpClient发送带有标头和参数的get请求,java,android,Java,Android,我需要将此发送到服务器: Authorization SCToken 282518f3-95b90c08-9453-4cce-9a73-eb80cb7f86e1 this send like a HEADER 还有这个 modify_after 2017-06-09T11:06:37Z like a QUERY 我这样做: public void getUpdate(String token , String lastModify, AsyncHttpResponseHandler han

我需要将此发送到服务器:

Authorization SCToken 282518f3-95b90c08-9453-4cce-9a73-eb80cb7f86e1 this send like a HEADER
还有这个

modify_after 2017-06-09T11:06:37Z like a QUERY 
我这样做:

public void getUpdate(String token , String lastModify, AsyncHttpResponseHandler handler){
    syncHttpClient = new SyncHttpClient();
    client.addHeader("Accept", "application/json");
    syncHttpClient.addHeader("Accept", "application/json");
    BasicHeader[] headers = new BasicHeader[]{new    BasicHeader("Authorization", "SCToken " + token)};
    Log.e("get ", token + "   , " + getAbsoluteUrl("last_state/?modify_after=" + lastModify));
    syncHttpClient.get(context, getAbsoluteUrl("last_state/?modify_after=" + lastModify), headers, null, handler);
}

但是从服务器上得到的答案是失败的,状态是404。

404当您尝试连接到一个不存在的网站时,会发生HTTP错误。。。你在代码中正确地输入了URL吗?一定有一些有效的URL,你刚刚使用了URL的某个部分,结果是404。你是否使用诸如postman之类的工具验证了服务器的有效工作?@Geryson@Thecave3是的,我再添加一个字符谢谢你的帮助