Problem Httpclient very slow

PetrTNPetrTN Member
edited December 2018 in Xamarin.Android

Hello,
I have a problem with Httpclient on the Android device.

I have a code:
private async void GetProducts()
{
Console.WriteLine("nowTest");
var client = new HttpClient(new Xamarin.Android.Net.AndroidClientHandler());
var response = await client.GetStringAsync("h ttp://" + ipAddress + "/api/index.php);
Console.WriteLine(response);
}

When I'm in the local network "192.168.1.10" then the request returns to max 1-2s.
When I'm on the Internet, the request always takes more than 30s.

Project settings:
HttpClient implementation: Android
SSL/TLS: Default(Native TLS 1.2+)

I do not use the proxy!
Tested: Still the same 30s
var handler = new AndroidClientHandler { UseProxy = false };
var client = new HttpClient(handler);

Where can the problem be?
Please help me. Thank you.

Sign In or Register to comment.