Package org.apache.http.impl.client


package org.apache.http.impl.client
Default HTTP client implementation.

The usual execution flow can be demonstrated by the code snippet below:

CloseableHttpClient httpclient = HttpClients.createDefault();
try {
     HttpGet httpGet = new HttpGet("http://targethost/homepage");
     CloseableHttpResponse response = httpclient.execute(httpGet);
     try {
         System.out.println(response.getStatusLine());
         HttpEntity entity = response.getEntity();
         // do something useful with the response body
         // and ensure it is fully consumed
         EntityUtils.consume(entity);
     } finally {
         response.close();
     }
} finally {
     httpclient.close();
}