我想下载一个文件,需要检查响应状态码(即HTTP /1.1 200 OK
)。这是我的代码的片段:
HttpGet httpRequest = new HttpGet(myUri);
HttpEntity httpEntity = null;
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httpRequest);
...
我如何获得响应的状态码?
我想下载一个文件,需要检查响应状态码(即HTTP /1.1 200 OK
)。这是我的代码的片段:
HttpGet httpRequest = new HttpGet(myUri);
HttpEntity httpEntity = null;
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httpRequest);
...
我如何获得响应的状态码?