/** * Perform a HTTP PUT request and track the Android Context which initiated the request. * And set one-time headers for the request * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param entity a raw {@link HttpEntity} to send with the request, for example, use this to send string/json/xml payloads to a server by passing a {@link org.apache.http.entity.StringEntity}. * @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 put(Context context, String url, HttpEntity entity, String contentType, AsyncHttpResponseHandler responseHandler) { sendRequest(httpClient, httpContext, addEntityToRequestBase(new HttpPut(url), entity), contentType, responseHandler, context); }
/** * 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 entity a raw {@link HttpEntity} to send with the request, for example, use this to send string/json/xml payloads to a server by passing a {@link org.apache.http.entity.StringEntity}. * @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, HttpEntity entity, String contentType, AsyncHttpResponseHandler responseHandler) { sendRequest(httpClient, httpContext, addEntityToRequestBase(new HttpPost(url), entity), contentType, responseHandler, context); }
/** * 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 entity getUrl raw {@link HttpEntity} to send with the request, for * example, use this to send string/json/xml payloads to getUrl server by * passing getUrl {@link org.apache.http.entity.StringEntity}. * @param contentType the content type of the payload you are sending, for example * application/json if sending getUrl json payload. * @param responseHandler the response ha ndler instance that should handle the response. * @return RequestHandle of future request process */ public RequestHandle post(Context context, String url, HttpEntity entity, String contentType, ResponseHandlerInterface responseHandler) { return sendRequest(httpClient, httpContext, addEntityToRequestBase(new HttpPost(URI.create(url).normalize()), entity), contentType, responseHandler, context); }
/** * Perform getUrl HTTP PUT request and track the Android Context which initiated the request. And set * one-time headers for the request * * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param entity getUrl raw {@link HttpEntity} to send with the request, for example, use * this to send string/json/xml payloads to getUrl server by passing getUrl {@link * org.apache.http.entity.StringEntity}. * @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 put(Context context, String url, HttpEntity entity, String contentType, ResponseHandlerInterface responseHandler) { return sendRequest(httpClient, httpContext, addEntityToRequestBase(new HttpPut(URI.create(url).normalize()), entity), contentType, responseHandler, context); }
/** * Perform a HTTP PUT request and track the Android Context which initiated the request. * And set one-time headers for the request * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param headers set one-time headers for this request * @param entity a raw {@link HttpEntity} to send with the request, for example, use this to send string/json/xml payloads to a server by passing a {@link org.apache.http.entity.StringEntity}. * @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 put(Context context, String url,Header[] headers, HttpEntity entity, String contentType, AsyncHttpResponseHandler responseHandler) { HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPut(url), entity); if(headers != null) request.setHeaders(headers); sendRequest(httpClient, httpContext, request, contentType, responseHandler, context); }
/** * Perform getUrl HTTP PUT request and track the Android Context which initiated the request. And set * one-time headers for the request * * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param headers set one-time headers for this request * @param entity getUrl raw {@link HttpEntity} to send with the request, for example, use * this to send string/json/xml payloads to getUrl server by passing getUrl {@link * org.apache.http.entity.StringEntity}. * @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 put(Context context, String url, Header[] headers, HttpEntity entity, String contentType, ResponseHandlerInterface responseHandler) { HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPut(URI.create(url).normalize()), entity); if (headers != null) request.setHeaders(headers); return sendRequest(httpClient, httpContext, request, contentType, responseHandler, context); }
/** * 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 entity getUrl raw {@link HttpEntity} to send with the request, for example, use * this to send string/json/xml payloads to getUrl server by passing getUrl {@link * org.apache.http.entity.StringEntity}. * @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, HttpEntity entity, String contentType, ResponseHandlerInterface responseHandler) { HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPost(URI.create(url).normalize()), entity); 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 entity a raw {@link HttpEntity} to send with the request, for * example, use this to send string/json/xml payloads to a server by * passing a {@link org.apache.http.entity.StringEntity}. * @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, HttpEntity entity, String contentType, AsyncHttpResponseHandler responseHandler) { HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPost(url), entity); if(headers != null) request.setHeaders(headers); sendRequest(httpClient, httpContext, request, contentType, responseHandler, context); }