Adding a SocketsHttpHandler to an HttpClient created via AddHttpClient in Startup.cs?

Viewed 1342

I'd like to add a SocketsHttpHandler to an HttpClient that I am creating via AddHttpClient in Startup.cs. The point of that is to be able to inject instrumentation etc. in the HttpClient via a factory.

This does not give me the option to use the constructor of HttpClient, which is where you'd usually add a SocketsHttpHandler.

Also, I don't see any obvious property etc. I can use to add it later.

1 Answers
Related