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


Java DefaultedHttpParams类代码示例

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


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

示例1: getRequestParams

import org.apache.http.params.DefaultedHttpParams; //导入依赖的package包/类
protected HttpParams getRequestParams(StreamRequestMessage requestMessage) {
    HttpParams localParams = new BasicHttpParams();

    localParams.setParameter(
            CoreProtocolPNames.PROTOCOL_VERSION,
            requestMessage.getOperation().getHttpMinorVersion() == 0 ? HttpVersion.HTTP_1_0 : HttpVersion.HTTP_1_1
    );

    // DefaultHttpClient adds HOST header automatically in its default processor

    // Let's add the user-agent header on every request
    HttpProtocolParams.setUserAgent(
            localParams,
            getConfiguration().getUserAgentValue(requestMessage.getUdaMajorVersion(), requestMessage.getUdaMinorVersion())
    );

    return new DefaultedHttpParams(localParams, globalParams);
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:19,代码来源:StreamClientImpl.java

示例2: getRequestParams

import org.apache.http.params.DefaultedHttpParams; //导入依赖的package包/类
protected HttpParams getRequestParams(StreamRequestMessage requestMessage) {
    HttpParams localParams = new BasicHttpParams();

    localParams.setParameter(
        CoreProtocolPNames.PROTOCOL_VERSION,
        requestMessage.getOperation().getHttpMinorVersion() == 0 ? HttpVersion.HTTP_1_0 : HttpVersion.HTTP_1_1
    );

    // DefaultHttpClient adds HOST header automatically in its default processor

    // Add the default user agent if not already set on the message
    if (!requestMessage.getHeaders().containsKey(UpnpHeader.Type.USER_AGENT)) {
        HttpProtocolParams.setUserAgent(
            localParams,
            getConfiguration().getUserAgentValue(requestMessage.getUdaMajorVersion(), requestMessage.getUdaMinorVersion())
        );
    }

    return new DefaultedHttpParams(localParams, globalParams);
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:21,代码来源:StreamClientImpl.java

示例3: getRequestParams

import org.apache.http.params.DefaultedHttpParams; //导入依赖的package包/类
protected HttpParams getRequestParams(StreamRequestMessage requestMessage) {
    HttpParams localParams = new BasicHttpParams();

    localParams.setParameter(CoreProtocolPNames.PROTOCOL_VERSION,
            requestMessage.getOperation().getHttpMinorVersion() == 0 ? HttpVersion.HTTP_1_0 : HttpVersion.HTTP_1_1);

    // DefaultHttpClient adds HOST header automatically in its default processor

    // Let's add the user-agent header on every request
    HttpProtocolParams.setUserAgent(localParams, getConfiguration()
            .getUserAgentValue(requestMessage.getUdaMajorVersion(), requestMessage.getUdaMinorVersion()));

    return new DefaultedHttpParams(localParams, globalParams);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:15,代码来源:StreamClientImpl.java

示例4: getResponseParams

import org.apache.http.params.DefaultedHttpParams; //导入依赖的package包/类
protected HttpParams getResponseParams(UpnpOperation operation) {
    HttpParams localParams = new BasicHttpParams();
    return new DefaultedHttpParams(localParams, params);
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:5,代码来源:HttpServerConnectionUpnpStream.java


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