あまり情報がないので、
★The respone entity is always not null and is stream,so the
releaseConnection method cant be invoked always.
final HttpEntity entity = response.getEntity();
if (entity == null || !entity.isStreaming()) {
★
- Using
EntityUtilsandHttpEntity
HttpResponse response = httpClient.execute(new HttpGet(URL)); HttpEntity entity = response.getEntity(); String responseString = EntityUtils.toString(entity, "UTF-8"); System.out.println(responseString); - Using
BasicResponseHandler
HttpResponse response = httpClient.execute(new HttpGet(URL)); String responseString = new BasicResponseHandler().handleResponse(response); System.out.println(responseString);基本なことね、恥ずかしい、全てのresponeはStreamみたいなので、また調べる