/** * Perform getUrl HTTP POST request and track the Android Context which initiated the request. * * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param params additional POST parameters or files to send with the request. * @param responseHandler the response handler instance that should handle the response. * @return RequestHandle of future request process */ public RequestHandle post(Context context, String url, RequestParams params, ResponseHandlerInterface responseHandler) { return post(context, url, paramsToEntity(params, responseHandler), null, responseHandler); }
/** * Perform a HTTP POST request and track the Android Context which initiated the request. * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param params additional POST parameters or files to send with the request. * @param responseHandler the response handler instance that should handle the response. */ public void post(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler) { post(context, url, paramsToEntity(params), null, responseHandler); }
/** * Perform getUrl HTTP PUT request and track the Android Context which initiated the request. * * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param params additional PUT parameters or files to send with the request. * @param responseHandler the response handler instance that should handle the response. * @return RequestHandle of future request process */ public RequestHandle put(Context context, String url, RequestParams params, ResponseHandlerInterface responseHandler) { return put(context, url, paramsToEntity(params, responseHandler), null, responseHandler); }
/** * Perform a HTTP PUT request and track the Android Context which initiated the request. * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param params additional PUT parameters or files to send with the request. * @param responseHandler the response handler instance that should handle the response. */ public void put(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler) { put(context, url, paramsToEntity(params), null, responseHandler); }
/** * Perform getUrl HTTP POST request and track the Android Context which initiated the request. Set * headers only for this request * * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param headers set headers only for this request * @param params additional POST parameters to send with the request. * @param contentType the content type of the payload you are sending, for example * application/json if sending getUrl json payload. * @param responseHandler the response handler instance that should handle the response. * @return RequestHandle of future request process */ public RequestHandle post(Context context, String url, Header[] headers, RequestParams params, String contentType, ResponseHandlerInterface responseHandler) { HttpEntityEnclosingRequestBase request = new HttpPost(URI.create(url).normalize()); if (params != null) request.setEntity(paramsToEntity(params, responseHandler)); if (headers != null) request.setHeaders(headers); return sendRequest(httpClient, httpContext, request, contentType, responseHandler, context); }
/** * Perform a HTTP POST request and track the Android Context which initiated * the request. Set headers only for this request * * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param headers set headers only for this request * @param params additional POST parameters to send with the request. * @param contentType the content type of the payload you are sending, for * example application/json if sending a json payload. * @param responseHandler the response handler instance that should handle * the response. */ public void post(Context context, String url, Header[] headers, RequestParams params, String contentType, AsyncHttpResponseHandler responseHandler) { HttpEntityEnclosingRequestBase request = new HttpPost(url); if(params != null) request.setEntity(paramsToEntity(params)); if(headers != null) request.setHeaders(headers); sendRequest(httpClient, httpContext, request, contentType, responseHandler, context); }