Package org.apache.http.impl.nio.client

Default asynchronous HTTP client implementation.

See: Description

Package org.apache.http.impl.nio.client Description

Default asynchronous HTTP client implementation.

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

 CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault();
 try {
     httpclient.start();
     HttpGet request = new HttpGet("http://www.apache.org/");
     Future future = httpclient.execute(request, null);
     HttpResponse response = future.get();
     System.out.println(response.getStatusLine());
     // Do something useful with the response body
 } finally {
     httpclient.close();
 }
 

Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.