Java 类org.apache.http.params.DefaultedHttpParams 实例源码

项目:openhab-hdl    文件:StreamClientImpl.java   
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);
}
项目:DroidDLNA    文件:StreamClientImpl.java   
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);
}
项目:openhab1-addons    文件:StreamClientImpl.java   
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);
}
项目:DroidDLNA    文件:HttpServerConnectionUpnpStream.java   
protected HttpParams getResponseParams(UpnpOperation operation) {
    HttpParams localParams = new BasicHttpParams();
    return new DefaultedHttpParams(localParams, params);
}