本文整理汇总了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);
}
示例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);
}
示例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);
}
示例4: getResponseParams
import org.apache.http.params.DefaultedHttpParams; //导入依赖的package包/类
protected HttpParams getResponseParams(UpnpOperation operation) {
HttpParams localParams = new BasicHttpParams();
return new DefaultedHttpParams(localParams, params);
}