Closed jeremy-bridges closed 5 years ago
Also, is there plans to reduce the number of new instances of HttpClient that the runtime creates? There's overhead in making a lot of those:
Yes. Update 3 will have a way to do this.
With Xamarin.Android you can use the XA_HTTP_CLIENT_HANDLER_TYPE
environment to use a different handler (this is normally set via the project settings, but can also be set to a custom type via code). That is documented here: https://developer.xamarin.com/guides/android/advanced_topics/environment/ and you can see the implementation here: https://github.com/xamarin/xamarin-android/blob/0c26b71339a1027902f72e3842077feb7d9c7d9b/src/Mono.Android/Android.Runtime/AndroidEnvironment.cs#L319
Is there plans to have an API to inject a custom http handler?