1

The following line of code works fine on emulator but times out when tested on real Android devices The following is my C# code, any suggestion on how to fix the error.

var HttpClient = new HttpClient();
HttpClient.Timeout = TimeSpan.FromSeconds(200);
var response = await HttpClient.GetStringAsync("https://myUrl");  
Chetan Rawat
  • 578
  • 3
  • 17
  • Does this answer your question? [How can I tell when HttpClient has timed out?](https://stackoverflow.com/questions/10547895/how-can-i-tell-when-httpclient-has-timed-out) – Ive Mar 10 '20 at 09:22
  • Remove the Timeout to catch the exception. The Timeout exception thrown when the timeout is elapsed doesn’t let you determine the cause of the error. We need know what real error is. – Wendy Zang - MSFT Mar 11 '20 at 06:52

0 Answers0