你的位置: 码友网首页 / 资讯源列表 / Using HttpClientFactory in ASP.NET Core Applications

关于[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/

收录时间: 2021-03-04 浏览量: 1518 分类: ASP.NET Core

| 0 收藏 | 0