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


Java HttpUriRequest类代码示例

本文整理汇总了Java中khandroid.ext.apache.http.client.methods.HttpUriRequest的典型用法代码示例。如果您正苦于以下问题:Java HttpUriRequest类的具体用法?Java HttpUriRequest怎么用?Java HttpUriRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: performRequest

import khandroid.ext.apache.http.client.methods.HttpUriRequest; //导入依赖的package包/类
@Override
public org.apache.http.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);

	HttpResponse resp = mClient.execute(httpRequest);

	return convertResponseNewToOld(resp);
}
 
开发者ID:himanshuagarwal77225,项目名称:BookMySkills,代码行数:21,代码来源:ExtHttpClientStack.java

示例2: performRequest

import khandroid.ext.apache.http.client.methods.HttpUriRequest; //导入依赖的package包/类
@Override
public org.apache.http.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);

    HttpResponse resp = mClient.execute(httpRequest);

    return convertResponseNewToOld(resp);
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:21,代码来源:ExtHttpClientStack.java

示例3: addHeaders

import khandroid.ext.apache.http.client.methods.HttpUriRequest; //导入依赖的package包/类
private static void addHeaders(HttpUriRequest httpRequest, Map<String, String> headers)
{
	for (String key : headers.keySet())
	{
		httpRequest.setHeader(key, headers.get(key));
	}
}
 
开发者ID:himanshuagarwal77225,项目名称:BookMySkills,代码行数:8,代码来源:ExtHttpClientStack.java

示例4: addHeaders

import khandroid.ext.apache.http.client.methods.HttpUriRequest; //导入依赖的package包/类
private static void addHeaders(HttpUriRequest httpRequest, Map<String, String> headers) {
    for (String key : headers.keySet()) {
        httpRequest.setHeader(key, headers.get(key));
    }
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:6,代码来源:ExtHttpClientStack.java

示例5: onPrepareRequest

import khandroid.ext.apache.http.client.methods.HttpUriRequest; //导入依赖的package包/类
/**
 * Called before the request is executed using the underlying HttpClient.
 * <p>
 * Overwrite in subclasses to augment the request.
 * </p>
 */
protected void onPrepareRequest(HttpUriRequest request) throws IOException
{
	// Nothing.
}
 
开发者ID:himanshuagarwal77225,项目名称:BookMySkills,代码行数:11,代码来源:ExtHttpClientStack.java

示例6: onPrepareRequest

import khandroid.ext.apache.http.client.methods.HttpUriRequest; //导入依赖的package包/类
/**
 * Called before the request is executed using the underlying HttpClient.
 * 
 * <p>
 * Overwrite in subclasses to augment the request.
 * </p>
 */
protected void onPrepareRequest(HttpUriRequest request) throws IOException {
    // Nothing.
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:11,代码来源:ExtHttpClientStack.java


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