httpclient 応答ハンドラーを実装しています。行われている呼び出しはpost
このようなものです
result = httpclient.execute(httppost, responsehandler);
今、私は自分の応答ハンドラーを実装したいと考えています。応答のステータス コードを取得できるようにします。ステータス コード、つまり 200、404、403 のみに関心があり、この応答をint値として送り返したい
何かのようなもの
public class MyResponseHandler implements ResponseHandler<Integer> {
public Integer handleResponse(HttpResponse respons) throws ClientProtocolException, IOException {
// TODO Auto-generated method stub
return 0;
}
response.getStatusCode()
問題は、応答オブジェクトにメソッドが表示されないことです。WS 呼び出しのステータス コードを取得する方法は?