Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何访问Xamarin中的Org.Apache.Http.Impl.client.DefaultHttpclient?_C#_Android_Https_Xamarin - Fatal编程技术网

C# 如何访问Xamarin中的Org.Apache.Http.Impl.client.DefaultHttpclient?

C# 如何访问Xamarin中的Org.Apache.Http.Impl.client.DefaultHttpclient?,c#,android,https,xamarin,C#,Android,Https,Xamarin,我正在尝试处理一个长时间的HTTPS请求。我的原始代码使用ServicePointManager.ServerCertificateValidationCallback,为服务器响应增加了至少5秒的延迟。我有一个用java编写的类,速度非常快,我正在尝试将其转换为C 这是我的翻译,最后两行没有编译,让我抓狂,我如何实例化ThreadSafeClientConnManager和DefaultHttpClient using Org.Apache.Http.Conn.Schemes;

我正在尝试处理一个长时间的HTTPS请求。我的原始代码使用ServicePointManager.ServerCertificateValidationCallback,为服务器响应增加了至少5秒的延迟。我有一个用java编写的类,速度非常快,我正在尝试将其转换为C

这是我的翻译,最后两行没有编译,让我抓狂,我如何实例化ThreadSafeClientConnManager和DefaultHttpClient

    using Org.Apache.Http.Conn.Schemes;
    using Org.Apache.Http.Conn;
    using Org.Apache.Http.Conn.Ssl;
    using Org.Apache.Http.Params;



    IHttpParams httpParams;
    IClientConnectionManager ccm;

    KeyStore store = KeyStore.GetInstance (KeyStore.DefaultType);
    store.Load (null, null);
    SSLSocketFactory sslSocketFact = new SSLSocketFactory (store);
    sslSocketFact.HostnameVerifier = SSLSocketFactory.AllowAllHostnameVerifier;

    httpParams = new BasicHttpParams();
    HttpProtocolParams.SetVersion(httpParams, Org.Apache.Http.HttpVersion.Http11);
    HttpProtocolParams.SetContentCharset(httpParams, "UTF-8");

    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.Register(new Scheme("http", PlainSocketFactory.SocketFactory, 80));
    schemeRegistry.Register(new Scheme("https", sslSocketFact, 443));

    new ThreadSafeClientConnManager(httpParams, schemeRegistry);
    HttpClient client =  new DefaultHttpClient(ccm, httpParams);