/** * Perform a HTTP GET request and track the Android Context which initiated the request with * customized headers * * @param url the URL to send the request to. * @param headers set headers only for this request * @param params additional GET parameters to send with the request. * @param responseHandler the response handler instance that should handle the response. */ public void get( Context context, String url, Header[] headers, RequestParams params, AsyncHttpResponseHandler responseHandler) { HttpUriRequest request = new HttpGet(getUrlWithQueryString(url, params)); if (headers != null) request.setHeaders(headers); sendRequest(httpClient, httpContext, request, null, responseHandler, context); }
/** * Perform a HTTP HEAD request and track the Android Context which initiated the request with * customized headers * * @param context Context to execute request against * @param url the URL to send the request to. * @param headers set headers only for this request * @param params additional HEAD parameters to send with the request. * @param responseHandler the response handler instance that should handle the response. */ public RequestHandle head( Context context, String url, Header[] headers, RequestParams params, AsyncHttpResponseHandler responseHandler) { HttpUriRequest request = new HttpHead(getUrlWithQueryString(isUrlEncodingEnabled, url, params)); if (headers != null) request.setHeaders(headers); return sendRequest(httpClient, httpContext, request, null, responseHandler, context); }
public void delete( Context context, String str, Header[] headerArr, AsyncHttpResponseHandler asyncHttpResponseHandler) { HttpUriRequest httpDelete = new HttpDelete(str); if (headerArr != null) { httpDelete.setHeaders(headerArr); } sendRequest( this.httpClient, this.httpContext, httpDelete, null, asyncHttpResponseHandler, context); }
public void get( Context context, String str, Header[] headerArr, RequestParams requestParams, AsyncHttpResponseHandler asyncHttpResponseHandler) { HttpUriRequest httpGet = new HttpGet(getUrlWithQueryString(str, requestParams)); if (headerArr != null) { httpGet.setHeaders(headerArr); } sendRequest( this.httpClient, this.httpContext, httpGet, null, asyncHttpResponseHandler, context); }
public void post( Context context, String str, Header[] headerArr, RequestParams requestParams, String str2, AsyncHttpResponseHandler asyncHttpResponseHandler) { HttpUriRequest httpPost = new HttpPost(str); if (requestParams != null) { httpPost.setEntity(paramsToEntity(requestParams)); } if (headerArr != null) { httpPost.setHeaders(headerArr); } sendRequest( this.httpClient, this.httpContext, httpPost, str2, asyncHttpResponseHandler, context); }
public void put( Context context, String str, Header[] headerArr, HttpEntity httpEntity, String str2, AsyncHttpResponseHandler asyncHttpResponseHandler) { HttpUriRequest addEntityToRequestBase = addEntityToRequestBase(new HttpPut(str), httpEntity); if (headerArr != null) { addEntityToRequestBase.setHeaders(headerArr); } sendRequest( this.httpClient, this.httpContext, addEntityToRequestBase, str2, asyncHttpResponseHandler, context); }
public Object getSync(String url, Header[] headers, AjaxParams params) { HttpUriRequest request = new HttpGet(getUrlWithQueryString(url, params)); if (headers != null) request.setHeaders(headers); return sendSyncRequest(httpClient, httpContext, request, null); }
public void get( String url, Header[] headers, AjaxParams params, AjaxCallBack<? extends Object> callBack) { HttpUriRequest request = new HttpGet(getUrlWithQueryString(url, params)); if (headers != null) request.setHeaders(headers); sendRequest(httpClient, httpContext, request, null, callBack); }