@@ -15,19 +15,19 @@ Latest `version`: [![Maven][mavenImg]][mavenLink]
1515
1616## Installation
1717
18- First, in order to add it to your Maven project, simply add this dependency:
18+ First, in order to add it to your Maven project, simply add this dependency -- see [ mvnrepository ] ( http://mvnrepository.com/artifact/org.asynchttpclient/async-http-client ) for latest version :
1919
2020``` xml
2121<dependency >
22- <groupId >com.ning </groupId >
23- <artifactId >async-http-client</artifactId >
24- <version >version </version >
22+ <groupId >org.asynchttpclient </groupId >
23+ <artifactId >async-http-client</artifactId >
24+ <version >2.0.0-RC12 </version >
2525</dependency >
2626```
2727
2828You can also download the artifact
2929
30- [ Maven Search] ( http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.ning%22%20AND%20a%3A%22async -http-client%22 )
30+ [ Maven Search] ( http://mvnrepository.com/artifact/org.asynchttpclient/async -http-client )
3131
3232AHC is an abstraction layer that can work on top of the bare JDK, Netty and Grizzly.
3333Note that the JDK implementation is very limited and you should ** REALLY** use the other * real* providers.
@@ -66,11 +66,11 @@ Check [migration guide](MIGRATION.md) for migrating from 1.8 to 1.9.
6666Then in your code you can simply do
6767
6868``` java
69- import com.ning.http.client .* ;
69+ import org.asynchttpclient .* ;
7070import java.util.concurrent.Future ;
7171
7272AsyncHttpClient asyncHttpClient = new AsyncHttpClient ();
73- Future<Response > f = asyncHttpClient. prepareGet(" http://www.ning .com/" ). execute();
73+ Future<Response > f = asyncHttpClient. prepareGet(" http://www.example .com/" ). execute();
7474Response r = f. get();
7575```
7676
@@ -79,11 +79,11 @@ Note that in this case all the content must be read fully in memory, even if you
7979You can also accomplish asynchronous (non-blocking) operation without using a Future if you want to receive and process the response in your handler:
8080
8181``` java
82- import com.ning.http.client .* ;
82+ import org.asynchttpclient .* ;
8383import java.util.concurrent.Future ;
8484
8585AsyncHttpClient asyncHttpClient = new AsyncHttpClient ();
86- asyncHttpClient. prepareGet(" http://www.ning .com/" ). execute(new AsyncCompletionHandler<Response > (){
86+ asyncHttpClient. prepareGet(" http://www.example .com/" ). execute(new AsyncCompletionHandler<Response > (){
8787
8888 @Override
8989 public Response onCompleted (Response response ) throws Exception {
@@ -104,11 +104,11 @@ asyncHttpClient.prepareGet("http://www.ning.com/").execute(new AsyncCompletionHa
104104You can also mix Future with AsyncHandler to only retrieve part of the asynchronous response
105105
106106``` java
107- import com.ning.http.client .* ;
107+ import org.asynchttpclient .* ;
108108import java.util.concurrent.Future ;
109109
110110AsyncHttpClient asyncHttpClient = new AsyncHttpClient ();
111- Future<Integer > f = asyncHttpClient. prepareGet(" http://www.ning .com/" ). execute(
111+ Future<Integer > f = asyncHttpClient. prepareGet(" http://www.example .com/" ). execute(
112112 new AsyncCompletionHandler<Integer > (){
113113
114114 @Override
@@ -131,11 +131,11 @@ which is something you want to do for large responses: this way you can process
131131 You have full control on the Response life cycle, so you can decide at any moment to stop processing what the server is sending back:
132132
133133``` java
134- import com.ning.http.client .* ;
134+ import org.asynchttpclient .* ;
135135import java.util.concurrent.Future ;
136136
137137AsyncHttpClient c = new AsyncHttpClient ();
138- Future<String > f = c. prepareGet(" http://www.ning .com/" ). execute(new AsyncHandler<String > () {
138+ Future<String > f = c. prepareGet(" http://www.example .com/" ). execute(new AsyncHandler<String > () {
139139 private ByteArrayOutputStream bytes = new ByteArrayOutputStream ();
140140
141141 @Override
0 commit comments