Когда IHttpClientFactory внутренне закрывает TCP-соединение? ⇐ C#
Когда IHttpClientFactory внутренне закрывает TCP-соединение?
based on the article https://learn.microsoft.com/en-us/dotne ... p-requests
// in startup.cs builder.Services.AddHttpClient() .SetHandlerLifetime(TimeSpan.FromMinutes(5)); // usage public class CatalogService : ICatalogService { private readonly HttpClient _httpClient; private readonly string _remoteServiceBaseUrl; public CatalogService(HttpClient httpClient) { _httpClient = httpClient; } public async Task GetCatalogItems(int page, int take, int? brand, int? type) { var uri = API.Catalog.GetAllCatalogItems(_remoteServiceBaseUrl, page, take, brand, type); var responseString = await _httpClient.GetStringAsync(uri); //
Источник: https://stackoverflow.com/questions/780 ... internally
based on the article https://learn.microsoft.com/en-us/dotne ... p-requests
// in startup.cs builder.Services.AddHttpClient() .SetHandlerLifetime(TimeSpan.FromMinutes(5)); // usage public class CatalogService : ICatalogService { private readonly HttpClient _httpClient; private readonly string _remoteServiceBaseUrl; public CatalogService(HttpClient httpClient) { _httpClient = httpClient; } public async Task GetCatalogItems(int page, int take, int? brand, int? type) { var uri = API.Catalog.GetAllCatalogItems(_remoteServiceBaseUrl, page, take, brand, type); var responseString = await _httpClient.GetStringAsync(uri); //
Источник: https://stackoverflow.com/questions/780 ... internally
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение