Java 您可以从JsonHttpResponseHandler()获取Http头吗
我正在使用android的Http库,我需要能够从get请求访问响应头 我该怎么做呢? 以下是我用于发出正常请求的代码: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
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代码
如果您有任何建议,我们将不胜感激。您使用的是什么图书馆?