Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Problem with calling service method in Xamarin Forms

$
0
0

For calling service methods I use System.Net.Http.HttpClient. When I start application in Android and try to call method I get an error message "System.Net.WebException: Error: SendFailure (Error writing headers)"

var client = new System.Net.Http.HttpClient();
client.BaseAddress = new Uri("https://5.250.245.222/api/misc/");
var response = await client.GetAsync("getPhoneNumber");
response.Headers.Add("Api-Authentication", "e6g8nDeHo7i692P79xdHCUzjArWg0HH4");
var jsonRes = response.Content.ReadAsStringAsync().Result;

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>