SenseNet / sn-client-dotnet

A .Net client for sensenet that makes it easy to use the REST API of the Content Repository.
https://www.sensenet.com/
GNU General Public License v2.0
7 stars 16 forks source link

Use IHttpClientFactory to avoid socket exhaustion in DefaultRestCaller #102

Closed tusmester closed 1 month ago

tusmester commented 1 year ago

We should NOT instantiate HttpClient directly but through the factory that will handle the connection pooling for us.

For details: https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests

using HttpClient client = _httpClientFactory.CreateClient();