org.apache.http.params.DefaultedHttpParams Java Examples

The following examples show how to use org.apache.http.params.DefaultedHttpParams. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: TVRemoteIME   Author: kingthy   File: StreamClientImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #2
Source Project: DroidDLNA   Author: offbye   File: StreamClientImpl.java    License: GNU General Public License v3.0 6 votes vote down vote up
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);
}
 
Example #3
Source Project: openhab1-addons   Author: openhab   File: StreamClientImpl.java    License: Eclipse Public License 2.0 5 votes vote down vote up
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);
}
 
Example #4
Source Project: TVRemoteIME   Author: kingthy   File: HttpServerConnectionUpnpStream.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected HttpParams getResponseParams(UpnpOperation operation) {
    HttpParams localParams = new BasicHttpParams();
    return new DefaultedHttpParams(localParams, params);
}
 
Example #5
Source Project: DroidDLNA   Author: offbye   File: HttpServerConnectionUpnpStream.java    License: GNU General Public License v3.0 4 votes vote down vote up
protected HttpParams getResponseParams(UpnpOperation operation) {
    HttpParams localParams = new BasicHttpParams();
    return new DefaultedHttpParams(localParams, params);
}