Skip to content

Instantly share code, notes, and snippets.

@jfarcand
Created November 12, 2010 22:04
Show Gist options
  • Save jfarcand/674776 to your computer and use it in GitHub Desktop.
Save jfarcand/674776 to your computer and use it in GitHub Desktop.
AsyncHttpClient client = new AsyncHttpClient();
TransferCompletionHandler tl = new TransferCompletionHandler();
tl.addTransferListener(new TransferListener() {
public void onStart() {
}
public void onBytesTransfered(ByteBuffer buffer) {
// Do something with the bytes
}
public void onEnd() {
}
public void onTrowable(Throwable t) {
}
});
Response response = httpClient.prepareGet("http://...").execute(tl).get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment