What problem does it solve?
This skill documents best practices for consuming HTTP APIs in .NET to avoid socket exhaustion, DNS staleness, duplicated HTTP logic, and fragile retry implementations when calling external services.
Core Features & Use Cases
- IHttpClientFactory patterns for named and typed clients to centralize configuration and lifetime management.
- DelegatingHandler pipelines for cross-cutting concerns such as correlation IDs, bearer token propagation, API key injection, and request/response logging.
- Resilience pipeline integration covering retries, hedging, attempt and total timeouts, and circuit breakers to make HTTP calls robust.
- Testing guidance including unit tests with mock HttpMessageHandler and integration tests using DI and WebApplicationFactory.
- Use Case: implement a typed CatalogApiClient that encapsulates API calls, composes DelegatingHandlers, and is protected by a standard resilience handler.
Quick Start
Register a typed CatalogApiClient with AddHttpClient, add transient DelegatingHandlers for correlation and bearer token propagation, and attach the standard resilience handler to protect outbound requests.