当前位置: 首页>>代码示例>>Java>>正文


Java HttpEntityEnclosingRequestBase.setHeaders方法代码示例

本文整理汇总了Java中org.apache.http.client.methods.HttpEntityEnclosingRequestBase.setHeaders方法的典型用法代码示例。如果您正苦于以下问题:Java HttpEntityEnclosingRequestBase.setHeaders方法的具体用法?Java HttpEntityEnclosingRequestBase.setHeaders怎么用?Java HttpEntityEnclosingRequestBase.setHeaders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.http.client.methods.HttpEntityEnclosingRequestBase的用法示例。


在下文中一共展示了HttpEntityEnclosingRequestBase.setHeaders方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: syncPut

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public String syncPut(String url, Header[] headers, HttpEntity entity, String contentType, String defaultEncoding)
		throws ClientProtocolException, IOException {
	HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPut(url), entity);
	if (headers != null)
		request.setHeaders(headers);
	if (contentType != null) {
		request.setHeader("Content-Type", contentType);
	}
	return parseResponse(syncExec(request), defaultEncoding);
}
 
开发者ID:ROKOLabs,项目名称:ROKO.Stickers-Android,代码行数:11,代码来源:AsyncHttpClient.java

示例2: post

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
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(this.httpClient, this.httpContext, request, contentType, responseHandler, context);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:AsyncHttpClient.java

示例3: post

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public RequestHandle post(Context context, String url, Header[] headers, RequestParams
        params, String contentType, ResponseHandlerInterface responseHandler) {
    HttpEntityEnclosingRequestBase request = new HttpPost(getURI(url));
    if (params != null) {
        request.setEntity(paramsToEntity(params, responseHandler));
    }
    if (headers != null) {
        request.setHeaders(headers);
    }
    return sendRequest(this.httpClient, this.httpContext, request, contentType,
            responseHandler, context);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:13,代码来源:AsyncHttpClient.java

示例4: put

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public RequestHandle put(Context context, String url, Header[] headers, HttpEntity entity,
                         String contentType, ResponseHandlerInterface responseHandler) {
    HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPut(getURI(url)),
            entity);
    if (headers != null) {
        request.setHeaders(headers);
    }
    return sendRequest(this.httpClient, this.httpContext, request, contentType,
            responseHandler, context);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:AsyncHttpClient.java

示例5: patch

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public RequestHandle patch(Context context, String url, Header[] headers, HttpEntity entity,
                           String contentType, ResponseHandlerInterface responseHandler) {
    HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPatch(getURI(url)
    ), entity);
    if (headers != null) {
        request.setHeaders(headers);
    }
    return sendRequest(this.httpClient, this.httpContext, request, contentType,
            responseHandler, context);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:AsyncHttpClient.java

示例6: syncPost

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public String syncPost(String url, Header[] headers, HttpEntity entity, String contentType, String defaultEncoding)
		throws ClientProtocolException, IOException {
	HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPost(url), entity);
	if (headers != null)
		request.setHeaders(headers);
	if (contentType != null) {
		request.setHeader("Content-Type", contentType);
	}
	return parseResponse(syncExec(request), defaultEncoding);
}
 
开发者ID:ROKOLabs,项目名称:ROKO.Stickers-Android,代码行数:11,代码来源:AsyncHttpClient.java

示例7: postSync

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public String postSync(String url, Header[] headers, RequestParams params,
		String contentType) {
	HttpEntityEnclosingRequestBase request = new HttpPost(generateUrl(url));
	if (params != null)
		request.setEntity(invokeParamsToEntity(params, new DefaultHttpResponseHandler()));
	if (headers != null)
		request.setHeaders(headers);
	return sendSyncRequest(getHttpClient(), getHttpContext(), request,
			contentType);
}
 
开发者ID:ccliu2015,项目名称:love,代码行数:11,代码来源:HttpManager.java

示例8: put

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public RequestHandle put(Context context, String s, Header aheader[], HttpEntity httpentity, String s1, ResponseHandlerInterface responsehandlerinterface)
{
    HttpEntityEnclosingRequestBase httpentityenclosingrequestbase = a(new HttpPut(URI.create(s).normalize()), httpentity);
    if (aheader != null)
    {
        httpentityenclosingrequestbase.setHeaders(aheader);
    }
    return sendRequest(c, d, httpentityenclosingrequestbase, s1, responsehandlerinterface, context);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:10,代码来源:AsyncHttpClient.java

示例9: post

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public RequestHandle post(Context context, String s, Header aheader[], HttpEntity httpentity, String s1, ResponseHandlerInterface responsehandlerinterface)
{
    HttpEntityEnclosingRequestBase httpentityenclosingrequestbase = a(new HttpPost(URI.create(s).normalize()), httpentity);
    if (aheader != null)
    {
        httpentityenclosingrequestbase.setHeaders(aheader);
    }
    return sendRequest(c, d, httpentityenclosingrequestbase, s1, responsehandlerinterface, context);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:10,代码来源:AsyncHttpClient.java

示例10: put

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public void put(String url,Header[] headers, HttpEntity entity, String contentType, AjaxCallBack<? extends Object> callBack) {
    HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPut(url), entity);
    if(headers != null) request.setHeaders(headers);
    sendRequest(httpClient, httpContext, request, contentType, callBack);
}
 
开发者ID:cdkd321,项目名称:pure,代码行数:6,代码来源:FinalHttp.java

示例11: postSync

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public Object postSync( String url, Header[] headers, HttpEntity entity, String contentType) {
    HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPost(url), entity);
    if(headers != null) request.setHeaders(headers);
    return sendSyncRequest(httpClient, httpContext, request, contentType);
}
 
开发者ID:DuGuQiuBai,项目名称:Android-Basics-Codes,代码行数:6,代码来源:FinalHttp.java

示例12: post

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public <T> void post( String url, Header[] headers, AjaxParams params, String contentType,AjaxCallBack<T> callBack) {
    HttpEntityEnclosingRequestBase request = new HttpPost(url);
    if(params != null) request.setEntity(paramsToEntity(params));
    if(headers != null) request.setHeaders(headers);
    sendRequest(httpClient, httpContext, request, contentType, callBack);
}
 
开发者ID:cdkd321,项目名称:pure,代码行数:7,代码来源:FinalHttp.java

示例13: putSync

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
public Object putSync(String url,Header[] headers, HttpEntity entity, String contentType) {
    HttpEntityEnclosingRequestBase request = addEntityToRequestBase(new HttpPut(url), entity);
    if(headers != null) request.setHeaders(headers);
    return sendSyncRequest(httpClient, httpContext, request, contentType);
}
 
开发者ID:cdkd321,项目名称:pure,代码行数:6,代码来源:FinalHttp.java

示例14: post

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:22,代码来源:AsyncHttpClient.java

示例15: post

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; //导入方法依赖的package包/类
/**
 * 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.
 * @return String
 * @throws HttpException
 */
public String post(Context context, String url, Header[] headers, RequestParams params, String contentType) throws HttpException {
    HttpEntityEnclosingRequestBase request = new HttpPost(url);
    if (params != null) request.setEntity(paramsToEntity(params));
    if (headers != null) request.setHeaders(headers);
    return sendRequest(httpClient, httpContext, request, contentType, context);
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:20,代码来源:SyncHttpClient.java


注:本文中的org.apache.http.client.methods.HttpEntityEnclosingRequestBase.setHeaders方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。