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


Java Header类代码示例

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


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

示例1: convertResponseNewToOld

import khandroid.ext.apache.http.Header; //导入依赖的package包/类
private org.apache.http.HttpResponse convertResponseNewToOld(HttpResponse resp) throws IllegalStateException,
		IOException
{

	ProtocolVersion protocolVersion = new ProtocolVersion(resp.getProtocolVersion().getProtocol(), resp
			.getProtocolVersion().getMajor(), resp.getProtocolVersion().getMinor());

	StatusLine responseStatus = new BasicStatusLine(protocolVersion, resp.getStatusLine().getStatusCode(), resp
			.getStatusLine().getReasonPhrase());

	BasicHttpResponse response = new BasicHttpResponse(responseStatus);
	org.apache.http.HttpEntity ent = convertEntityNewToOld(resp.getEntity());
	response.setEntity(ent);

	for (Header h : resp.getAllHeaders())
	{
		org.apache.http.Header header = convertheaderNewToOld(h);
		response.addHeader(header);
	}

	return response;
}
 
开发者ID:himanshuagarwal77225,项目名称:BookMySkills,代码行数:23,代码来源:ExtHttpClientStack.java

示例2: convertEntityNewToOld

import khandroid.ext.apache.http.Header; //导入依赖的package包/类
private org.apache.http.HttpEntity convertEntityNewToOld(HttpEntity ent) throws IllegalStateException, IOException
{

	BasicHttpEntity ret = new BasicHttpEntity();
	if (ent != null)
	{
		ret.setContent(ent.getContent());
		ret.setContentLength(ent.getContentLength());
		Header h;
		h = ent.getContentEncoding();
		if (h != null)
		{
			ret.setContentEncoding(convertheaderNewToOld(h));
		}
		h = ent.getContentType();
		if (h != null)
		{
			ret.setContentType(convertheaderNewToOld(h));
		}
	}

	return ret;
}
 
开发者ID:himanshuagarwal77225,项目名称:BookMySkills,代码行数:24,代码来源:ExtHttpClientStack.java

示例3: convertResponseNewToOld

import khandroid.ext.apache.http.Header; //导入依赖的package包/类
private org.apache.http.HttpResponse convertResponseNewToOld(HttpResponse resp) 
        throws IllegalStateException, IOException {
    
    ProtocolVersion protocolVersion = new ProtocolVersion(resp.getProtocolVersion()
            .getProtocol(),
                                                          resp.getProtocolVersion().getMajor(),
                                                          resp.getProtocolVersion().getMinor());

    StatusLine responseStatus = new BasicStatusLine(protocolVersion,
                                                    resp.getStatusLine().getStatusCode(),
                                                    resp.getStatusLine().getReasonPhrase());

    BasicHttpResponse response = new BasicHttpResponse(responseStatus);
    org.apache.http.HttpEntity ent = convertEntityNewToOld(resp.getEntity());
    response.setEntity(ent);

    for (Header h : resp.getAllHeaders()) {
        org.apache.http.Header header = convertheaderNewToOld(h);
        response.addHeader(header);
    }

    return response;
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:24,代码来源:ExtHttpClientStack.java

示例4: convertEntityNewToOld

import khandroid.ext.apache.http.Header; //导入依赖的package包/类
private org.apache.http.HttpEntity convertEntityNewToOld(HttpEntity ent) 
        throws IllegalStateException, IOException {
    
    BasicHttpEntity ret = new BasicHttpEntity();
    if (ent != null) {
        ret.setContent(ent.getContent());
        ret.setContentLength(ent.getContentLength());
        Header h;
        h = ent.getContentEncoding();
        if (h != null) {
            ret.setContentEncoding(convertheaderNewToOld(h));
        }
        h = ent.getContentType();
        if (h != null) {
            ret.setContentType(convertheaderNewToOld(h));
        }
    }

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

示例5: convertheaderNewToOld

import khandroid.ext.apache.http.Header; //导入依赖的package包/类
private org.apache.http.Header convertheaderNewToOld(Header header)
{
	org.apache.http.Header ret = new BasicHeader(header.getName(), header.getValue());
	return ret;
}
 
开发者ID:himanshuagarwal77225,项目名称:BookMySkills,代码行数:6,代码来源:ExtHttpClientStack.java

示例6: convertheaderNewToOld

import khandroid.ext.apache.http.Header; //导入依赖的package包/类
private org.apache.http.Header convertheaderNewToOld(Header header) {
    org.apache.http.Header ret = new BasicHeader(header.getName(), header.getValue());
    return ret;
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:5,代码来源:ExtHttpClientStack.java


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