问题 Everywhere I can see three main approaches to create clients (basic, named, typed) in DI, but I have found nowhere if to inject IHttpClientFactory or HttpClient (both possible). Q1 : What is the difference between injecting IHttpClientFactory or HttpClient please? Q2 : And if IHttpClientFactory is injected, should I use factory.CreateClient() for each call? 回答1: Summary HttpClient can only be injected inside Typed clients for other usages, you need IHttpClientFactory In both scenarios, the