Soenneker.Html.Client
4.0.1079
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Html.Client --version 4.0.1079
NuGet\Install-Package Soenneker.Html.Client -Version 4.0.1079
<PackageReference Include="Soenneker.Html.Client" Version="4.0.1079" />
<PackageVersion Include="Soenneker.Html.Client" Version="4.0.1079" />
<PackageReference Include="Soenneker.Html.Client" />
paket add Soenneker.Html.Client --version 4.0.1079
#r "nuget: Soenneker.Html.Client, 4.0.1079"
#:package Soenneker.Html.Client@4.0.1079
#addin nuget:?package=Soenneker.Html.Client&version=4.0.1079
#tool nuget:?package=Soenneker.Html.Client&version=4.0.1079
Soenneker.Html.Client
Provides a cached, dependency-injection-friendly HttpClient for retrieving HTML.
Install
dotnet add package Soenneker.Html.Client
Register
using Soenneker.Html.Client.Registrars;
services.AddHtmlClientAsSingleton();
Use AddHtmlClientAsScoped() when each dependency-injection scope must own an independent client. Its cache is scoped as well, so disposing one scope cannot remove another scope's client.
Usage
using Soenneker.Html.Client.Abstract;
public sealed class PageLoader(IHtmlClient htmlClient)
{
public async Task<string> Load(Uri uri, CancellationToken cancellationToken)
{
HttpClient client = await htmlClient.Get(cancellationToken);
return await client.GetStringAsync(uri, cancellationToken);
}
}
Get() lazily creates the client and reuses it for the registered service lifetime. The client has no base address or site-specific headers, so pass an absolute URI and configure each request as needed.
Let the dependency-injection container dispose IHtmlClient. If you construct it yourself, dispose the wrapper rather than the returned HttpClient.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Utils.HttpClientCache (>= 4.0.2045)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Html.Client:
| Package | Downloads |
|---|---|
|
Soenneker.Html.Parser
A utility library for HTML parsing related operations |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1096 | 47 | 9/9/2026 |
| 4.0.1095 | 88 | 9/8/2026 |
| 4.0.1094 | 82 | 9/8/2026 |
| 4.0.1093 | 91 | 9/7/2026 |
| 4.0.1092 | 88 | 9/7/2026 |
| 4.0.1091 | 134 | 9/5/2026 |
| 4.0.1090 | 118 | 9/4/2026 |
| 4.0.1089 | 96 | 9/4/2026 |
| 4.0.1088 | 94 | 9/4/2026 |
| 4.0.1085 | 133 | 9/3/2026 |
| 4.0.1084 | 89 | 9/1/2026 |
| 4.0.1083 | 96 | 8/31/2026 |
| 4.0.1081 | 87 | 8/31/2026 |
| 4.0.1080 | 88 | 8/31/2026 |
| 4.0.1079 | 82 | 8/31/2026 |
| 4.0.1078 | 139 | 8/30/2026 |
| 4.0.1077 | 89 | 8/30/2026 |
| 4.0.1076 | 86 | 8/30/2026 |
| 4.0.1075 | 115 | 8/30/2026 |
| 4.0.1074 | 85 | 8/30/2026 |
Update dependency Soenneker.Utils.HttpClientCache to 4.0.2045 (#1617)