dotnet-httpclient

HttpClient DelegatingHandler unexpected life cycle

瘦欲@ 提交于 2020-12-04 19:57:30
问题 In ASP.NET Core 2.1 app I am making REST request using HttpClient . I am using DelegatingHandler s to define some common behavior. The registration i here: private static void AddRestServiceDataClient<TTypedHttpClient, TTypedHttpClientImpl>(this IServiceCollection services) where TTypedHttpClient : class where TTypedHttpClientImpl : RestServiceDataClient, TTypedHttpClient { var httpClientBuilder = services .AddHttpClient<TTypedHttpClient, TTypedHttpClientImpl>() .AddHttpMessageHandler