Skip to content

Instantly share code, notes, and snippets.

@kevinherron
Created September 12, 2010 00:55
Show Gist options
  • Save kevinherron/575734 to your computer and use it in GitHub Desktop.
Save kevinherron/575734 to your computer and use it in GitHub Desktop.
package com.kevinherron.campfire.playground;
import java.util.concurrent.Future;
import com.ning.http.client.AsyncCompletionHandler;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.Realm;
import com.ning.http.client.Request;
import com.ning.http.client.Response;
public class Problem {
public static void main(String[] args) throws Exception {
AsyncHttpClient client = new AsyncHttpClient();
Realm realm = new Realm.RealmBuilder()
.setPrincipal("EDITED")
.setPassword("X")
.build();
Request request = client
.prepareGet(String.format("https://inductiveautomation.campfirenow.com/rooms.xml"))
.setRealm(realm)
.build();
Future<String> f = client.executeRequest(request, new AsyncCompletionHandler<String>() {
@Override
public String onCompleted(Response response) throws Exception {
return response.getResponseBody();
}
});
System.out.println(f.get());
System.out.println("Exiting...");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment