[System.Net.Http] Simplify default http message handler for watchOS since there's...
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Mon, 3 Oct 2016 16:21:40 +0000 (18:21 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Mon, 3 Oct 2016 16:22:12 +0000 (18:22 +0200)
mcs/class/System.Net.Http/HttpClientEx.cs

index 59456d6df0bb91dbaaae0de6a84b01c3e6b4ccf0..14ebd8ff85de73380a0b30f2e7c0aa41363ffeef 100644 (file)
@@ -29,7 +29,12 @@ namespace System.Net.Http {
                // but we want this to work "as expected" even if the application is not being linked
                static HttpMessageHandler GetDefaultHandler ()
                {
+#if MONOTOUCH_WATCH
+                       // There's only one valid handler type for watchOS
+                       return new NSUrlSessionHandler ();
+#else
                        return RuntimeOptions.GetHttpMessageHandler ();
+#endif
                }
        }
 #else