Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/313.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 您可以从JsonHttpResponseHandler()获取Http头吗_Java_Android_Http_Http Headers - Fatal编程技术网

Java 您可以从JsonHttpResponseHandler()获取Http头吗

Java 您可以从JsonHttpResponseHandler()获取Http头吗,java,android,http,http-headers,Java,Android,Http,Http Headers,我正在使用android的Http库,我需要能够从get请求访问响应头 我该怎么做呢? 以下是我用于发出正常请求的代码: public void getPublicTimeline() throws JSONException { MyHttpClass.get("statuses/public_timeline.json", null, new JsonHttpResponseHandler() { @Override public void onSucce

我正在使用android的Http库,我需要能够从get请求访问响应头

我该怎么做呢? 以下是我用于发出正常请求的代码:

public void getPublicTimeline() throws JSONException {
MyHttpClass.get("statuses/public_timeline.json", null, new JsonHttpResponseHandler() {
    @Override
    public void onSuccess(JSONArray timeline) {
        // Pull out the first event on the public timeline
        JSONObject firstEvent = timeline.get(0);
        String tweetText = firstEvent.getString("text");

        // Do something with the response
        System.out.println(tweetText);
    }
});
}
}
我需要访问响应头,因为我需要从头中获取nonce代码


如果您有任何建议,我们将不胜感激。

您使用的是什么图书馆?