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.

link xamarin documentation

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.

enter image description here


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -