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


Java HttpUriRequest.getParams方法代码示例

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


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

示例1: performRequest

import org.apache.http.client.methods.HttpUriRequest; //导入方法依赖的package包/类
/**
 * 请求执行
 * @param request the request to perform
 * @param additionalHeaders additional headers to be sent together with
 *         {@link Request#getHeaders()}
 * @return
 * @throws IOException
 * @throws AuthFailureError
 */
@Override
public HttpResponse performRequest(Request<?> request, Map<String, String> additionalHeaders)
        throws IOException, AuthFailureError {
    //传入request 进行创建封装过后的httprequest子类 httpurlrequest
    HttpUriRequest httpRequest = createHttpRequest(request, additionalHeaders);
    addHeaders(httpRequest, additionalHeaders);
    addHeaders(httpRequest, request.getHeaders());
    onPrepareRequest(httpRequest);
    HttpParams httpParams = httpRequest.getParams();
    int timeoutMs = request.getTimeoutMs();
    // TODO: Reevaluate this connection timeout based on more wide-scale
    // data collection and possibly different for wifi vs. 3G.
    HttpConnectionParams.setConnectionTimeout(httpParams, 5000);
    HttpConnectionParams.setSoTimeout(httpParams, timeoutMs);
    return mClient.execute(httpRequest);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:HttpClientStack.java

示例2: performRequest

import org.apache.http.client.methods.HttpUriRequest; //导入方法依赖的package包/类
@Override
public HttpResponse performRequest(Request<?> request, Map<String, String> additionalHeaders)
        throws IOException, AuthFailureError {
    HttpUriRequest httpRequest = createHttpRequest(request, additionalHeaders);
    addHeaders(httpRequest, additionalHeaders);
    addHeaders(httpRequest, request.getHeaders());
    onPrepareRequest(httpRequest);
    HttpParams httpParams = httpRequest.getParams();
    int timeoutMs = request.getTimeoutMs();
    // TODO: Reevaluate this connection timeout based on more wide-scale
    // data collection and possibly different for wifi vs. 3G.
    HttpConnectionParams.setConnectionTimeout(httpParams, 5000);
    HttpConnectionParams.setSoTimeout(httpParams, timeoutMs);
    return mClient.execute(httpRequest);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:HttpClientStack.java

示例3: performRequest

import org.apache.http.client.methods.HttpUriRequest; //导入方法依赖的package包/类
public HttpResponse performRequest(Request<?> request, Map<String, String> additionalHeaders) throws IOException, AuthFailureError {
    HttpUriRequest httpRequest = createHttpRequest(request, additionalHeaders);
    addHeaders(httpRequest, additionalHeaders);
    addHeaders(httpRequest, request.getHeaders());
    onPrepareRequest(httpRequest);
    HttpParams httpParams = httpRequest.getParams();
    int timeoutMs = request.getTimeoutMs();
    HttpConnectionParams.setConnectionTimeout(httpParams, BaseImageDownloader.DEFAULT_HTTP_CONNECT_TIMEOUT);
    HttpConnectionParams.setSoTimeout(httpParams, timeoutMs);
    return this.mClient.execute(httpRequest);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:HttpClientStack.java


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