关于[Using HttpClientFactory in ASP.NET Core Applications]的摘要:
Up until now, we’ve been using HttpClient directly in our services. In every service, we’ve created an HttpClient instance and all the required configurations. That lead to repeating code in all of our service classes. Well, in this article we are going to learn how to prevent that by using HttpClientFactory. Of course, this is not the only advantage of using HttpClientFactory. We are going to learn how HttpClientFactory prevents additional problems that HttpClient can cause. Additionally, we are going to show you how to create named and typed clients using HttpClientFactory.
原文地址: https://code-maze.com/using-httpclientfactory-in-asp-net-core-applications/