I'm trying to use the new IHttpClientFactory
with an ASP.net Core 2.1 WEB API application.
public void ConfigureServices(IServiceCollection services)
{
// other services configuration
services.AddHttpClient();
}
In my ConfigureServices
method, I don't see a way to add the IHttpClientFactory
and configure it to use WinHttpHandler
.
The AddHttpClient
methods that return a IHttpClientBuilder
gives you access to methods that configure the HttpMessageHandler
but those have to be derived from DelegatingHandler
but WinHttpHandler
does not derive from DelegatingHandler
.
See no way to tell HttpClient
to use WinHttpHandler
when being constructed.