public MyRestClient(Context context) {
    this.client = new AsyncHttpClient();
    myCookieStore = new PersistentCookieStore(context);
    client.getHttpClient().getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);

    client.setCookieStore(myCookieStore);
  }
Пример #2
0
 public static void setClient(AsyncHttpClient as) {
   client = as;
   client.addHeader("Accept-Language", Locale.getDefault().toString());
   client.addHeader("Host", HOST);
   client.addHeader("Connection", "Keep-Alive");
   client.getHttpClient().getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);
   setUserAgent(ApiClientHelper.getUserAgent(AppContext.getInstance()));
 }
Пример #3
0
 public HttpClient getHttpClient() {
   return client.getHttpClient();
 }