dotnet-http-client

Configure IHttpClientFactory with resilience and DelegatingHandler chains for .NET HTTP APIs.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-http-client-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-http-client
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-http-client
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-http-client-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the common challenges of consuming HTTP APIs in .NET applications, preventing issues like socket exhaustion and DNS staleness, and providing robust error handling.

Core Features & Use Cases

  • Efficient HTTP Client Management: Utilizes IHttpClientFactory for proper lifecycle management and connection pooling.
  • Named and Typed Clients: Supports both approaches for consuming different APIs with specific configurations or encapsulating API logic.
  • Resilience Integration: Seamlessly integrates with resilience patterns like retries, timeouts, and circuit breakers.
  • Delegating Handlers: Enables custom processing pipelines for concerns like authentication, logging, and correlation ID propagation.
  • Use Case: Automatically configure and use IHttpClientFactory to consume a third-party REST API, ensuring requests are resilient and properly authenticated using a DelegatingHandler.

Quick Start

Configure a typed HTTP client for consuming the 'catalog-api' service with resilience.

Frequently Asked Questions about dotnet-http-client

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my .NET HttpClient suffer from socket exhaustion and DNS staleness?

Directly instantiating an HttpClient in .NET can cause socket exhaustion and DNS staleness. Using IHttpClientFactory manages client lifecycles and connection pooling to resolve these issues.

What is the best way to consume HTTP APIs in .NET with custom authentication pipelines?

The best way to consume HTTP APIs with custom authentication is using typed clients with IHttpClientFactory, configuring custom DelegatingHandler chains for cross-cutting concerns like correlation IDs.

How do I add resilience and circuit breakers to my .NET HTTP client requests?

Add resilience to .NET HTTP client requests by integrating Microsoft.Extensions.Http.Resilience. This provides built-in retry, timeout, and circuit breaker patterns for your API consumption.

When should I use named clients versus typed clients in .NET?

Use named clients in .NET for consuming different APIs with specific configurations. Use typed clients when you want to encapsulate specific API logic within a dedicated class.

Can I use DelegatingHandlers with IHttpClientFactory for logging and correlation?

Yes, IHttpClientFactory supports custom DelegatingHandler pipelines. This enables you to process cross-cutting concerns like logging, authentication, and correlation ID propagation efficiently.