Closed LordMike closed 3 years ago
Here is my proposal:
Would that support the use case?
It will.
As a convenience, you can add the following overloads:
UseHttpClientFactory(string clientName)
(calls the below, and sets the name)UseHttpClientFactory(Action<Config> configure)
The second overload is already present. I'll keep that as the only one to avoid polluting the API with lots of different overloads.
This was added in 41da3457cf883eaa7a900cf404a8c2221f4d8a0e
Describe the feature One of the benefits of IHttpClientFactory is that the user (me) can configure a HttpClient that some library can use, through DI, without that library having to accept a HttpClient from myself. It seems that SimpleS3 does not use a named client, meaning the user can only configure the HttpClients used, by configuring the default HttpClient provided by the factory.
If two libraries were to do this, it wouldn't be possible to customize the options for just one of them.
Allow an optional name to be provided when using the
UseHttpClientFactory()
extensions to let the user control this.Code that creates the default client.