I have tested with http client from apache and it has been pretty easy.
No handling of the cookies as long as you have the connection open.
So take a look at it: http://hc.apache.org/httpclient-3.x/
I think I had this sniplet laying around.
package dk.jantzens.bbma;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
public class GetCookiePrintAndSetValue {
public static void main(String args[]) throws Exception {
HttpClient client = new DefaultHttpClient();
client.getParams().setParameter("http.useragent", "bbam");
HttpGet method = new HttpGet(
"http://www.buzzerbeater.com/BBAPI/login.aspx?login=USERNAME&code=CODE");
HttpGet method2 = new HttpGet(
"http://www.buzzerbeater.com/BBAPI/roster.aspx");
HttpResponse httpResponse = null;
try {
httpResponse = client.execute(method);
httpResponse = client.execute(method2);
// System.out.println(httpResponse.getText());
} catch (Exception e) {
System.err.println(e);
} finally {
method.abort();
}
}
}