本文整理汇总了C#中HttpClient.getParams方法的典型用法代码示例。如果您正苦于以下问题:C# HttpClient.getParams方法的具体用法?C# HttpClient.getParams怎么用?C# HttpClient.getParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClient
的用法示例。
在下文中一共展示了HttpClient.getParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitClient
private void InitClient()
{
lock(LOCK_OBJECT)
{
if((!_disableHttpConnectionPooling) && (_client == null))
{
_client = _sclient;
}
if(_client == null)
{
mainsoft.apache.commons.httpclient.MultiThreadedHttpConnectionManager manager =
new mainsoft.apache.commons.httpclient.MultiThreadedHttpConnectionManager();
manager.setConnectionStaleCheckingEnabled(false);
manager.setMaxTotalConnections(200);
//by some reasons RFC something - the default
//value will be 2 , so we need to change it ...
manager.setMaxConnectionsPerHost(20);
_client = new HttpClient(manager);
_client.getParams().setIntParameter(HttpClientParams.MAX_REDIRECTS, _defaultMaxRedirectsNum);
_client.getParams().setParameter(HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, new java.lang.Boolean(true));
_client.getParams().setParameter(HttpClientParams.CONNECTION_MANAGER_TIMEOUT, new java.lang.Long(30000));
_client.getParams().setParameter(HttpClientParams.USER_AGENT,
"VMW4J HttpClient (based on Jakarta Commons HttpClient)");
_client.getParams ().setBooleanParameter (HttpClientParams.SINGLE_COOKIE_HEADER, true);
java.util.ArrayList schemas = new java.util.ArrayList ();
schemas.add ("Ntlm");
schemas.add ("Digest");
schemas.add ("Basic");
schemas.add ("Negotiate");
_client.getParams ().setParameter (AuthPolicy.AUTH_SCHEME_PRIORITY, schemas);
if (!_disableHttpConnectionPooling) {
_sclient = _client;
}
}
}
}