c# - Xamarin Forms PCL HttpClient throwing unhandled exception on Android -
i using system.net.http.httpclient directly in xamarin.forms pcl. while runs absolutely fine on windows phone, on android throws unhandled exception on getasync line.
is there platform specific i'm missing?
var client = new httpclient(); var response = await client.getasync(constants.projectsuri); // breaks
use native android client handler
in android build settings, set httpclient implementation use androidclienthandler.
the androidclienthandler class introduced in xamarin.android 6.1 provide tls 1.2 support xamarin.android applications. class uses native java.net.urlconnection http connections, allowing httpclient instance use network , encryption protocols available android.

Comments
Post a Comment