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 File: StreamClientImpl.java    From TVRemoteIME with 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 File: StreamClientImpl.java    From DroidDLNA with 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 File: StreamClientImpl.java    From openhab1-addons with 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 File: HttpServerConnectionUpnpStream.java    From TVRemoteIME with 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 File: HttpServerConnectionUpnpStream.java    From DroidDLNA with 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);
}