I am scratching my head around this issue for a few days, I decided to ask great Xamarin community for help.
I have a mobile application which is communication with REST API running on IIS over HTTPS.
Android project settings
Minimum Android version: API 15
Target framework: Oreo
HttpClient implementation: Default
SSL/TLS implementation: Native TLS 1.2+
What is the issue?
For example, let's say I have GET api.mydomain.com/user/1 which will return some data.
Calls for most of the users are working just fine, but in some cases when calling user/86, for example, the call fails with a timeout.
I have the timeout set to 30s and after 30s I get:
System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: The operation has timed out.
at System.Net.HttpWebRequest+d__241`1[T].MoveNext () [0x000ba] in ...
If I call the same endpoint with Postman, for example, I get a valid response in just a few ms.
I checked on IIS, requests from a mobile application are received and IIS returns 200 with a proper response.
Other requests to the same REST API are working just fine.
This issue can be reproduced in the same environment, always same users are failing.
But with Postman they work just fine. JSON that is returned is well formatted and has no issue that I could see, also it is just a few KB in size.
Did anyone had any similar issues?