當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpUriRequest.setHeaders方法代碼示例

本文整理匯總了Java中org.apache.http.client.methods.HttpUriRequest.setHeaders方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpUriRequest.setHeaders方法的具體用法?Java HttpUriRequest.setHeaders怎麽用?Java HttpUriRequest.setHeaders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.http.client.methods.HttpUriRequest的用法示例。


在下文中一共展示了HttpUriRequest.setHeaders方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: get

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
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(this.httpClient, this.httpContext, request, null, responseHandler, context);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:8,代碼來源:AsyncHttpClient.java

示例2: head

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
public RequestHandle head(Context context, String url, Header[] headers, RequestParams
        params, ResponseHandlerInterface responseHandler) {
    HttpUriRequest request = new HttpHead(getUrlWithQueryString(this.isUrlEncodingEnabled,
            url, params));
    if (headers != null) {
        request.setHeaders(headers);
    }
    return sendRequest(this.httpClient, this.httpContext, request, null, responseHandler,
            context);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:11,代碼來源:AsyncHttpClient.java

示例3: get

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
public RequestHandle get(Context context, String url, Header[] headers, RequestParams params,
                         ResponseHandlerInterface responseHandler) {
    HttpUriRequest request = new HttpGet(getUrlWithQueryString(this.isUrlEncodingEnabled,
            url, params));
    if (headers != null) {
        request.setHeaders(headers);
    }
    return sendRequest(this.httpClient, this.httpContext, request, null, responseHandler,
            context);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:11,代碼來源:AsyncHttpClient.java

示例4: head

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
/**
 * 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.
 * @return RequestHandle of future request process
 */
public RequestHandle head(Context context, String url, Header[] headers, RequestParams params, ResponseHandlerInterface responseHandler) {
    HttpUriRequest request = new HttpHead(getUrlWithQueryString(isUrlEncodingEnabled, url, params));
    if (headers != null) request.setHeaders(headers);
    return sendRequest(httpClient, httpContext, request, null, responseHandler,
                       context);
}
 
開發者ID:LanguidSheep,項目名稱:sealtalk-android-master,代碼行數:18,代碼來源:AsyncHttpClient.java

示例5: get

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
/**
 * Perform a HTTP GET 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 GET parameters to send with the request.
 * @param responseHandler the response handler instance that should handle the response.
 * @return RequestHandle of future request process
 */
public RequestHandle get(Context context, String url, Header[] headers, RequestParams params, ResponseHandlerInterface responseHandler) {
    HttpUriRequest request = new HttpGet(getUrlWithQueryString(isUrlEncodingEnabled, url, params));
    if (headers != null) request.setHeaders(headers);
    return sendRequest(httpClient, httpContext, request, null, responseHandler,
                       context);
}
 
開發者ID:LanguidSheep,項目名稱:sealtalk-android-master,代碼行數:18,代碼來源:AsyncHttpClient.java

示例6: head

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
/**
 * 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.
 * @return RequestHandle of future request process
 */
public RequestHandle head(Context context, String url, Header[] headers, RequestParams params, ResponseHandlerInterface responseHandler) {
    HttpUriRequest request = new HttpHead(getUrlWithQueryString(isUrlEncodingEnabled, url, params));
    if (headers != null) request.setHeaders(headers);
    return sendRequest(httpClient, httpContext, request, null, responseHandler,
            context);
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:18,代碼來源:AsyncHttpClient.java

示例7: get

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
/**
 * Perform a HTTP GET 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 GET parameters to send with the request.
 * @param responseHandler the response handler instance that should handle the response.
 * @return RequestHandle of future request process
 */
public RequestHandle get(Context context, String url, Header[] headers, RequestParams params, ResponseHandlerInterface responseHandler) {
    HttpUriRequest request = new HttpGet(getUrlWithQueryString(isUrlEncodingEnabled, url, params));
    if (headers != null) request.setHeaders(headers);
    return sendRequest(httpClient, httpContext, request, null, responseHandler,
            context);
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:18,代碼來源:AsyncHttpClient.java

示例8: head

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
/**
 * Perform getUrl 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.
 * @return RequestHandle of future request process
 */
public RequestHandle head(Context context, String url, Header[] headers, RequestParams params, ResponseHandlerInterface responseHandler) {
    HttpUriRequest request = new HttpHead(getUrlWithQueryString(isUrlEncodingEnabled, url, params));
    if (headers != null) request.setHeaders(headers);
    return sendRequest(httpClient, httpContext, request, null, responseHandler,
            context);
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:18,代碼來源:AsyncHttpClient.java

示例9: get

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
/**
 * Perform getUrl HTTP GET 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 GET parameters to send with the request.
 * @param responseHandler the response handler instance that should handle the response.
 * @return RequestHandle of future request process
 */
public RequestHandle get(Context context, String url, Header[] headers, RequestParams params, ResponseHandlerInterface responseHandler) {
    HttpUriRequest request = new HttpGet(getUrlWithQueryString(isUrlEncodingEnabled, url, params));
    if (headers != null) request.setHeaders(headers);
    return sendRequest(httpClient, httpContext, request, null, responseHandler,
            context);
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:18,代碼來源:AsyncHttpClient.java

示例10: get

import org.apache.http.client.methods.HttpUriRequest; //導入方法依賴的package包/類
/**
 * Perform a HTTP GET 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 GET parameters to send with the request.
 * @return String
 * @throws HttpException
 */
public String get(Context context, String url, Header[] headers, RequestParams params) throws HttpException {
    HttpUriRequest request = new HttpGet(getUrlWithQueryString(isUrlEncodingEnabled, url, params));
    if (headers != null) request.setHeaders(headers);
    return sendRequest(httpClient, httpContext, request, null, context);
}
 
開發者ID:LanguidSheep,項目名稱:sealtalk-android-master,代碼行數:17,代碼來源:SyncHttpClient.java


注:本文中的org.apache.http.client.methods.HttpUriRequest.setHeaders方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。