Search in sources :

Example 1 with PersistentCookieStore

use of com.loopj.android.http.PersistentCookieStore in project UltimateAndroid by cymcsg.

the class HttpUtilsAsync method postWithCookie.

/**
     * Perform a HTTP POST request with cookie which generate by own context
     *
     * @param context
     * @param url
     * @param params
     * @param responseHandler
     */
public static void postWithCookie(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
    AsyncHttpClient client = new AsyncHttpClient();
    PersistentCookieStore myCookieStore = new PersistentCookieStore(context);
    client.setCookieStore(myCookieStore);
    client.post(getAbsoluteUrl(url), params, responseHandler);
}
Also used : PersistentCookieStore(com.loopj.android.http.PersistentCookieStore) AsyncHttpClient(com.loopj.android.http.AsyncHttpClient)

Example 2 with PersistentCookieStore

use of com.loopj.android.http.PersistentCookieStore in project UltimateAndroid by cymcsg.

the class HttpUtilsAsync method getWithCookie.

/**
     * Perform a HTTP GET request with cookie which generate by own context
     *
     * @param context
     * @param url
     * @param responseHandler
     */
public static void getWithCookie(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
    AsyncHttpClient client = new AsyncHttpClient();
    PersistentCookieStore myCookieStore = new PersistentCookieStore(context);
    client.setCookieStore(myCookieStore);
    client.get(getAbsoluteUrl(url), params, responseHandler);
}
Also used : PersistentCookieStore(com.loopj.android.http.PersistentCookieStore) AsyncHttpClient(com.loopj.android.http.AsyncHttpClient)

Example 3 with PersistentCookieStore

use of com.loopj.android.http.PersistentCookieStore in project UltimateAndroid by cymcsg.

the class HttpUtilsAsync method getWithCookie.

/**
     * Perform a HTTP GET request with cookie which generate by own context
     *
     * @param context
     * @param url
     * @param responseHandler
     */
public static void getWithCookie(Context context, String url, AsyncHttpResponseHandler responseHandler) {
    AsyncHttpClient client = new AsyncHttpClient();
    PersistentCookieStore myCookieStore = new PersistentCookieStore(context);
    //  myCookieStore.clear();
    client.setCookieStore(myCookieStore);
    client.get(getAbsoluteUrl(url), responseHandler);
}
Also used : PersistentCookieStore(com.loopj.android.http.PersistentCookieStore) AsyncHttpClient(com.loopj.android.http.AsyncHttpClient)

Example 4 with PersistentCookieStore

use of com.loopj.android.http.PersistentCookieStore in project UltimateAndroid by cymcsg.

the class HttpUtilsAsync method postWithCookie.

/**
     * Perform a HTTP POST request with cookie which generate by own context
     *
     * @param context
     * @param url
     * @param responseHandler
     */
public static void postWithCookie(Context context, String url, AsyncHttpResponseHandler responseHandler) {
    AsyncHttpClient client = new AsyncHttpClient();
    PersistentCookieStore myCookieStore = new PersistentCookieStore(context);
    //  myCookieStore.clear();
    client.setCookieStore(myCookieStore);
    client.post(getAbsoluteUrl(url), responseHandler);
}
Also used : PersistentCookieStore(com.loopj.android.http.PersistentCookieStore) AsyncHttpClient(com.loopj.android.http.AsyncHttpClient)

Example 5 with PersistentCookieStore

use of com.loopj.android.http.PersistentCookieStore in project android-async-http by loopj.

the class PersistentCookiesSample method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // Use the application's context so that memory leakage doesn't occur.
    cookieStore = new PersistentCookieStore(getApplicationContext());
    // Set the new cookie store.
    getAsyncHttpClient().setCookieStore(cookieStore);
    super.onCreate(savedInstanceState);
}
Also used : PersistentCookieStore(com.loopj.android.http.PersistentCookieStore)

Aggregations

PersistentCookieStore (com.loopj.android.http.PersistentCookieStore)5 AsyncHttpClient (com.loopj.android.http.AsyncHttpClient)4