![]() |
VOOZH | about |
dotnet add package Microsoft.Extensions.Http --version 10.0.9
NuGet\Install-Package Microsoft.Extensions.Http -Version 10.0.9
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.9" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.Http" />Project file
paket add Microsoft.Extensions.Http --version 10.0.9
#r "nuget: Microsoft.Extensions.Http, 10.0.9"
#:package Microsoft.Extensions.Http@10.0.9
#addin nuget:?package=Microsoft.Extensions.Http&version=10.0.9Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.Http&version=10.0.9Install as a Cake Tool
Microsoft.Extensions.Http package provides AddHttpClient extension methods for IServiceCollection, IHttpClientFactory interface and its default implementation. This provides the ability to set up named HttpClient configurations in a DI container and later retrieve them via an injected IHttpClientFactory instance.
HttpClient configurations for applications that use DI via AddHttpClient extension method.HttpClientFactory caches HttpMessageHandler instances per configuration name, which allows to reuse resources between HttpClient instances to avoid port exhaustion.HttpClientFactory manages lifetime of HttpMessageHandler instances and recycles connections to track DNS changes.Note that lifetime management of HttpClient instances created by HttpClientFactory is completely different from instances created manually. The strategies are to use either short-lived clients created by HttpClientFactory or long-lived clients with PooledConnectionLifetime set up. For more information, see the HttpClient lifetime management section in the conceptual docs and Guidelines for using HTTP clients.
builder.Services.AddHttpClient("foo"); // adding an HttpClient named "foo" with a default configuration
builder.Services.AddHttpClient("example", c => c.BaseAddress = new Uri("https://www.example.com")) // configuring HttpClient itself
.AddHttpMessageHandler<MyAuthHandler>() // adding additional delegating handlers to form a message handler chain
.ConfigurePrimaryHttpMessageHandler(b => new HttpClientHandler() { AllowAutoRedirect = false }) // configuring primary handler
.SetHandlerLifetime(TimeSpan.FromMinutes(30)); // changing the handler recycling interval
public class MyService
{
public MyService(IHttpClientFactory httpClientFactory)
{
_httpClientFactory = httpClientFactory; // injecting the factory
}
private Task<string> GetExampleAsync(Uri uri, CancellationToken ct)
{
HttpClient exampleClient = _httpClientFactory.CreateClient("example"); // creating the client for the specified name
return exampleClient.GetStringAsync(uri, ct); // using the client
}
}
The main types provided by this library are:
IHttpClientFactoryIHttpMessageHandlerFactoryHttpClientFactoryServiceCollectionExtensionsAddHttpClient extension method API docMicrosoft.Extensions.Http is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Microsoft.Extensions.Http:
| Package | Downloads |
|---|---|
|
Microsoft.Extensions.Http.Polly
The HttpClient factory is a pattern for configuring and retrieving named HttpClients in a composable way. This package integrates IHttpClientFactory with the Polly library, to add transient-fault-handling and resiliency through fluent policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback. This package was built from the source code at https://github.com/dotnet/dotnet/tree/f7b4c5716faaee8fb8a289aed29118cad955c45f |
|
|
Grpc.Net.ClientFactory
HttpClientFactory integration the for gRPC .NET client |
|
|
prometheus-net
.NET client library for the Prometheus monitoring and alerting system |
|
|
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs. |
|
|
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET). |
Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.Http:
| Repository | Stars |
|---|---|
|
jellyfin/jellyfin
The Free Software Media System - Server Backend & API
|
|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
dotnet/maui
.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
|
|
|
rocksdanister/lively
Free and open-source software that allows users to set animated desktop wallpapers and screensavers powered by WinUI 3.
|
|
|
duplicati/duplicati
Store securely encrypted backups in the cloud!
|
|
|
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
|
|
|
SubtitleEdit/subtitleedit
the subtitle editor :)
|
|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
|
dotnet/orleans
Cloud Native application framework for .NET
|
|
|
dotnet/eShop
A reference .NET application implementing an eCommerce site
|
|
|
restsharp/RestSharp
Simple REST and HTTP API Client for .NET
|
|
|
reactiveui/refit
The automatic type-safe REST library for .NET Core, Xamarin and .NET. Heavily inspired by Square's Retrofit library, Refit turns your REST API into a live interface.
|
|
|
JeffreySu/WeiXinMPSDK
微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 10.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
|
|
|
RayWangQvQ/BiliBiliToolPro
B 站(bilibili)自动任务工具,支持docker、青龙、k8s等多种部署方式。全面拥抱AI。敏感肌也能用。
|
|
|
STranslate/STranslate
A ready-to-go translation ocr tool developed with WPF/WPF 开发的一款即用即走的翻译、OCR工具
|
|
|
quartznet/quartznet
Quartz Enterprise Scheduler .NET
|
|
|
ant-design-blazor/ant-design-blazor
🌈A rich set of enterprise-class UI components based on Ant Design and Blazor.
|
|
|
microsoft/aspire
Aspire is the tool for code-first, extensible, observable dev and deploy.
|
|
|
Sylinko/Everywhere
On-screen aware AI assistant for your desktop. Uses current app context, multiple LLMs, and MCP tools to help you act across apps.
|
|
|
ChilliCream/graphql-platform
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Nitro the awesome Monaco based GraphQL IDE.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.5.26302.115 | 1,839 | 6/9/2026 |
| 11.0.0-preview.4.26230.115 | 21,600 | 5/12/2026 |
| 11.0.0-preview.3.26207.106 | 11,519 | 4/14/2026 |
| 11.0.0-preview.2.26159.112 | 15,055 | 3/10/2026 |
| 11.0.0-preview.1.26104.118 | 15,835 | 2/10/2026 |
| 10.0.9 | 791,449 | 6/9/2026 |
| 10.0.8 | 5,444,250 | 5/12/2026 |
| 10.0.7 | 7,295,925 | 4/21/2026 |
| 10.0.6 | 4,202,755 | 4/14/2026 |
| 10.0.5 | 9,757,713 | 3/12/2026 |
| 10.0.4 | 3,678,598 | 3/10/2026 |
| 10.0.3 | 10,795,487 | 2/10/2026 |
| 10.0.2 | 11,245,741 | 1/13/2026 |
| 10.0.1 | 10,894,139 | 12/9/2025 |
| 9.0.17 | 49,528 | 6/9/2026 |
| 9.0.16 | 290,506 | 5/12/2026 |
| 9.0.15 | 786,740 | 4/14/2026 |
| 9.0.14 | 920,998 | 3/10/2026 |
| 9.0.13 | 1,136,415 | 2/10/2026 |
| 9.0.12 | 1,157,694 | 1/13/2026 |