[ENHANCEMENT] Allow specifying a custom HttpClient to be used by MAUI #142
Replies: 4 comments
-
Please kindly inform if this isn´t the kind of contribution that you (i.e. #dotnet/maui) find useful. Been using Xamarin.Forms exclusively for mobile dev. MAUI concept has been treating several pain points existent in Xamarin.Forms. |
Beta Was this translation helpful? Give feedback.
-
This is not down to Android this is your approach in design you should be creating an http client using singleton approach this is not platform specific but the way you develop ur software |
Beta Was this translation helpful? Give feedback.
-
@davidbuckleyni to whom is the "you" in your comment referring to? (i clarified mine) |
Beta Was this translation helpful? Give feedback.
-
I am not sure about the implementation of HttpClient on Android (talking about the dotnet frameworks implementation, not the xamarin Android Platform Services implementation), but using the It's in general a good idea to switch to |
Beta Was this translation helpful? Give feedback.
-
On Android AndroidPlatformServices used for loading streams from Uris uses a HttpClient which a new instance is created for every time a resource needed.
Allowing to specify a custom HttpClient would enable numerous benefits:
The list goes on, just think of the benefits of a DelegatingHandler and you can add it to the list.
This isn´t specific to Android and should be considered as a whole.
Hopefully there still time for a change in MAUI
Reference
maui/System.Maui.Platform.Android/Forms.cs
Line 617 in 85ee7fe
maui/System.Maui.Platform.Android/Forms.cs
Lines 817 to 827 in 85ee7fe
Beta Was this translation helpful? Give feedback.
All reactions