com.loopj.android.http.ResponseHandlerInterface Java Examples
The following examples show how to use
com.loopj.android.http.ResponseHandlerInterface.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SubscriptionManager.java From pusher-websocket-android with MIT License | 6 votes |
public void sendSubscription(Subscription subscription) { String interest = subscription.getInterest(); InterestSubscriptionChange change = subscription.getChange(); JSONObject json = new JSONObject(); try { json.put("app_key", appKey); } catch (JSONException e) { Log.e(TAG, e.getMessage()); } StringEntity entity = new StringEntity(json.toString(), "UTF-8"); String url = options.buildNotificationURL("/clients/" + clientId + "/interests/" + interest); ResponseHandlerInterface handler = factory.newSubscriptionChangeHandler(subscription); AsyncHttpClient client = factory.newHttpClient(); switch (change) { case SUBSCRIBE: client.post(context, url, entity, "application/json", handler); break; case UNSUBSCRIBE: client.delete(context, url, entity, "application/json", handler); break; } }
Example #2
Source File: HttpUtils.java From foodie-app with Apache License 2.0 | 4 votes |
public static void getImage(String url, ResponseHandlerInterface responseHandler) { client.get(url, responseHandler); }
Example #3
Source File: HttpClientUtil.java From HttpAsyncTest with Apache License 2.0 | 4 votes |
public static void post(String urlString, RequestParams params, ResponseHandlerInterface bHandler) { client.post(urlString, params, bHandler); }