Esempio n. 1
0
 public HttpClient GetHttpClient(HttpClientImplementation implementation = HttpClientImplementation.Auto)
 {
     if (implementation == HttpClientImplementation.Managed)
     {
         return(new HttpClient());
     }
     if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
     {
         return(new HttpClient(new Xamarin.Android.Net.AndroidClientHandler()));
     }
     return(new HttpClient());
 }
Esempio n. 2
0
 public HttpClient GetHttpClient(HttpClientImplementation implementation = HttpClientImplementation.Auto)
 {
     if (implementation == HttpClientImplementation.Managed)
     {
         return(new HttpClient());
     }
     if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
     {
         return(new HttpClient(new NSUrlSessionHandler()));
     }
     else if (UIDevice.CurrentDevice.CheckSystemVersion(6, 0))
     {
         return(new HttpClient(new CFNetworkHandler()));
     }
     return(new HttpClient());
 }
Esempio n. 3
0
 public HttpClient GetHttpClient(HttpClientImplementation implementation = HttpClientImplementation.Auto)
 {
     // UWP currently does not support System.Net.ServicePointManager
     //System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
     return(new HttpClient());
 }
        public HttpClient GetHttpClient(HttpClientImplementation implementation = HttpClientImplementation.Auto)
        {
            var provider = DependencyService.Get <IHttpClientProvider>();

            return(provider.GetHttpClient(implementation));
        }