Search in sources :

Example 1 with AsyncHttpClient

use of com.loopj.android.http.AsyncHttpClient 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 AsyncHttpClient

use of com.loopj.android.http.AsyncHttpClient 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 AsyncHttpClient

use of com.loopj.android.http.AsyncHttpClient 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 AsyncHttpClient

use of com.loopj.android.http.AsyncHttpClient 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 AsyncHttpClient

use of com.loopj.android.http.AsyncHttpClient in project AnimeTaste by daimajia.

the class ApiConnector method get.

private void get(String request, JsonHttpResponseHandler handler) {
    AsyncHttpClient client = new AsyncHttpClient();
    client.setTimeout(10000);
    client.get(request, null, handler);
}
Also used : AsyncHttpClient(com.loopj.android.http.AsyncHttpClient)

Aggregations

AsyncHttpClient (com.loopj.android.http.AsyncHttpClient)13 PersistentCookieStore (com.loopj.android.http.PersistentCookieStore)4 AsyncHttpResponseHandler (com.loopj.android.http.AsyncHttpResponseHandler)3 Header (cz.msebera.android.httpclient.Header)2 NetworkException (com.xabber.android.data.NetworkException)1 OnResponseListener (com.xabber.android.data.connection.OnResponseListener)1 MessageItem (com.xabber.android.data.message.MessageItem)1 Request (com.xabber.xmpp.httpfileupload.Request)1 Slot (com.xabber.xmpp.httpfileupload.Slot)1 HttpClient (cz.msebera.android.httpclient.client.HttpClient)1 FileEntity (cz.msebera.android.httpclient.entity.FileEntity)1 DefaultHttpClient (cz.msebera.android.httpclient.impl.client.DefaultHttpClient)1 File (java.io.File)1 IQ (org.jivesoftware.smack.packet.IQ)1