1

I would like to use AndroidHttpClient instead of DefaultHttpClient. In the documentation is say:

This client processes cookies but does not retain them by default. To retain cookies, simply add a cookie store to the HttpContext:

context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);

Where do I get this context from??? Should I get it from the AndroidHttpClient or should I create it first and then pass it?

Asaf Pinhassi
  • 15,177
  • 12
  • 106
  • 130

1 Answers1

0
AndroidHttpClient client = AndroidHttpClient.newInstance(...);
HttpContext ctx = new BasicHttpContext();
ctx.setAttribute(...);
HttpGet get = new HttpGet(...);

client.execute(get, ctx);
gvaish
  • 9,374
  • 3
  • 38
  • 43