當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。