Wednesday, July 25, 2018

What's the best way to handle multiple HttpClients that might have varying BaseAddresses (depending on the request)?

So I've done some reading and obviously the best way seems to be having a singleton of the HttpClient, or even better instantiated from the HttpClientFactory as the factory will handle the disposal and DNS updates for you.

Now my issue is I might have up to 3000 different addresses it might connect to. What is the best approach to this? Right now I'm looking at named clients in the HttpClientFactory but can I create them at runtime? Will they still be managed correctly?

What's the best way to handle multiple HttpClients that might have varying BaseAddresses (depending on the request)? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team