HttpClient
The .NET class for sending HTTP requests and reading responses.
In more detail
Its methods are async, such as GetAsync and ReadFromJsonAsync. In ASP.NET Core create clients through IHttpClientFactory rather than new HttpClient(), so connections are reused and resilience handlers can be attached.
Related terms
- IHttpClientFactory — The ASP.NET Core factory that creates configured HttpClient instances, reusing connections and attaching handlers such as resilience.
- HTTP — The protocol web browsers and web servers use to send requests and responses.
- async and await — Language keywords for writing code that waits for slow work, such as a network call, without blocking a thread.
Taught in
- What is .NET? Runtime vs SDK, and LTS vs STS — Modern .NET Core, C# & Enterprise Microservices
- Async and Await: Managing Concurrency — Modern .NET Core, C# & Enterprise Microservices
- Retry and Circuit Breaker Policies with Polly — Modern .NET Core, C# & Enterprise Microservices
- Integration Testing with WebApplicationFactory — Modern .NET Core, C# & Enterprise Microservices