About 50 results
Open links in new tab
  1. HttpClientFactory.Create vs new HttpClient - Stack Overflow

    I am curious what is the purpose of the HttpClientFactory class. There is no description of why it exists on MSDN (see link). There are Create methods with more specialized arguments, but mostly I ...

  2. Create default HttpClientFactory for integration test

    17 My question now is how can I create a default HttpClientFactory for a simple functional integration test where I want to instantiate a typed client and see if I can hit the API and get a successful …

  3. Dependency injection: HttpClient or HttpClientFactory?

    Dec 11, 2019 · 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

  4. ASP.NET Core with HttpClientFactory : best practice?

    Dec 9, 2021 · } Can somebody tell me if it is a good practice calling cyclically var httpClient = httpClientFactory.CreateClient() (for instance every 5 seconds)? Could some side effects occur …

  5. c# - .NET Core : efficiency of using multiple HttpClientFactory ...

    Oct 22, 2024 · Here in this scenario multiple HttpClientFactory means having multiple pool of HttpMesageHandler where multiple socket will be taken at the same time and releasing each socket …

  6. c# - Configure HttpClientFactory to use data from the current request ...

    Jul 16, 2018 · With the new HttpClientFactory in ASP.NET Core 2.1, it's quite easy to configure custom HTTP clients with things like base urls, default headers etc. However, I haven't found a way to …

  7. c# - Proper use of HttpClientFactory for large amount of concurrent ...

    Jun 20, 2024 · Proper use of HttpClientFactory for large amount of concurrent requests Asked 1 year, 8 months ago Modified 1 year, 8 months ago Viewed 947 times

  8. Authentication per request using HttpClientFactory .net Core 2.1

    Feb 1, 2019 · How should I use HttpClientFactory to return an instance of HttpClient whose uri and credentials are determined at the point of the call? The existing code looks like this: var …

  9. c# - httpClientFactory- services AddHttpClient - Stack Overflow

    Aug 27, 2019 · public IndexModel(IHttpClientFactory httpClientFactory) { this._httpClient = httpClientFactory.CreateClient(); //now use the _httpclient in your class to make HTTP calls. } public …

  10. IHttpClientFactory Singleton .NET Framework - Stack Overflow

    Aug 13, 2020 · Just call AddHttpClient on the service collection, you don't need a DI framework or any other third-party library (potentially just an MS nuget) if you are not in core. From there you can just …