Let's Talk HTTP in .NET Core
summary
Demos refactor a naive controller that creates and disposes HttpClient into a working pattern using IHttpClientFactory to avoid socket exhaustion (20 sockets shown going TIME_WAIT), showing named and typed clients, a typed GitHub client class, and configurable handler lifetimes (defaults to two minutes). Adds outgoing middleware via delegating handlers, integrates Polly for retries, timeouts, circuit-breaker and bulkhead, and shows caching and stream-based JSON parsing to avoid large allocations; highlights the faster SocketHttpHandler in .NET Core 2.1.
AI-written summary · about
chapters (20)
- 0:00Intro
- 2:09Agenda
- 7:57HTTP Client
- 15:53Named Clients
- 18:12Type Clients
- 21:38Outgoing Middleware
- 23:58De delegating handlers
- 26:11Poly
- 30:10Retry
- 33:13Dynamic HTTP Error Policy
- 35:44Policy Registry
- 36:57Client Handler
- 37:59Handling Response Content
- 40:05Handling Errors
- 41:13Handling Cancellation
- 42:34Caching
- 45:26Extension Methods
- 47:10Correlation IDs
- 51:36Summary
- 54:08Outro
related talks
56mOptimizing your HttpClient usage
01h 01mHTTP on the Client in .NET: From WebRequest to SocketsHttpHandler
59mASP .NET Basics for Experts
01h 01mASP.NET Basics for Experts
01h 02mASP NET Core Beyond the Introductino
58mHead to Head #2
01h 00mDiagnosing issues in ASP.NET Core Applications
01h 01mWhat's New In ASP.NET Core
