import com.ning.http.client.*;
public class YAAHCExample {
public static void main(String[] args) throws Exception {
AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
asyncHttpClient.prepareGet("http://example.com").execute(new AsyncCompletionHandler<Response>() {
@Override
public Response onCompleted(Response response) throws Exception {
System.out.println(response.getResponseBody());
return response;
}
@Override
public void onThrowable(Throwable t) {
t.printStackTrace();
}
});
}
}