[Enhancement] Add ability to be able to create both managed and native HttpCLient handlers in shared code #2028
Labels
area-core-hosting
Extensions / Hosting / AppBuilder / Startup
t/enhancement ☀️
New feature or request
Projects
Milestone
Summary
In iOS and Android head projects, there is a project property setting to switch between using the managed HttpClient handlers and the native http client handlers for the platform, i.e. NSUrlSessionHandler (iOS) or AndroidClientHandler (Android).. In shared code if someone needs to add auth credentials, for instance for NTLM auth and wants to use the native handler (current managed HttpClientHandler on iOS has a bug that breaks NTLM auth), there is no way to create an HttpClient passing in a native handler without setting up a dependency service to create the HttpClient in the platform project such that a NSUrlSessionHandler/AndroidClientHandler can be passed in to the HttpClient constructor.
API Changes
Perhaps a FormsHttpClientHandler class can be created that would choose which http client handler to use based on the http client implementation selected in the iOS/Android project properties?
Intended Use Case
This would be useful to anyone who has to set properties on the HttpClientHandler before passing it into the HttpClient constructor, but wants to be able to do so from shared code and use whatever handler is set in the native project properties.
The text was updated successfully, but these errors were encountered: