Soenneker.Cloudflare.HttpClient
4.0.397
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Cloudflare.HttpClient --version 4.0.397
NuGet\Install-Package Soenneker.Cloudflare.HttpClient -Version 4.0.397
<PackageReference Include="Soenneker.Cloudflare.HttpClient" Version="4.0.397" />
<PackageVersion Include="Soenneker.Cloudflare.HttpClient" Version="4.0.397" />
<PackageReference Include="Soenneker.Cloudflare.HttpClient" />
paket add Soenneker.Cloudflare.HttpClient --version 4.0.397
#r "nuget: Soenneker.Cloudflare.HttpClient, 4.0.397"
#:package Soenneker.Cloudflare.HttpClient@4.0.397
#addin nuget:?package=Soenneker.Cloudflare.HttpClient&version=4.0.397
#tool nuget:?package=Soenneker.Cloudflare.HttpClient&version=4.0.397
Soenneker.Cloudflare.HttpClient
Provides cached, bearer-authenticated HttpClient instances for Cloudflare's v4 API.
Installation
dotnet add package Soenneker.Cloudflare.HttpClient
Configuration
{
"Cloudflare": {
"ApiKey": "your-api-token",
"RequestResponseLogging": false
}
}
Cloudflare:ApiKey is required. Enable request/response logging only when debug output is appropriate; the authorization header is redacted by the configured logging handler.
Registration and usage
using Soenneker.Cloudflare.HttpClient.Abstract;
using Soenneker.Cloudflare.HttpClient.Registrars;
services.AddCloudflareHttpClientAsSingleton();
public sealed class CloudflareZoneReader(ICloudflareHttpClient clientProvider)
{
public async Task<string> GetZone(
string zoneId,
CancellationToken cancellationToken)
{
HttpClient client = await clientProvider.Get(cancellationToken);
return await client.GetStringAsync($"zones/{zoneId}", cancellationToken);
}
}
Get(string apiKey) creates or reuses a separate client for that token. Every distinct token remains cached until the provider is disposed, so do not feed it an unbounded stream of short-lived credentials.
The provider owns all cache entries it creates. Disposing it removes and disposes those clients. Singleton registration is the normal application-wide lifetime; scoped registration creates isolated cache entries owned by each provider scope.
| 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.Extensions.Configuration (>= 4.0.868)
- Soenneker.HttpClients.LoggingHandler (>= 4.0.213)
- Soenneker.Utils.HttpClientCache (>= 4.0.2044)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Cloudflare.HttpClient:
| Package | Downloads |
|---|---|
|
Soenneker.Cloudflare.Utils.Client
An async thread-safe singleton for the Cloudflare OpenApiClient |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.401 | 0 | 8/31/2026 |
| 4.0.399 | 0 | 8/31/2026 |
| 4.0.398 | 0 | 8/31/2026 |
| 4.0.397 | 0 | 8/30/2026 |
| 4.0.396 | 21 | 8/30/2026 |
| 4.0.394 | 74 | 8/30/2026 |
| 4.0.393 | 70 | 8/30/2026 |
| 4.0.392 | 93 | 8/30/2026 |
| 4.0.390 | 100 | 8/30/2026 |
| 4.0.389 | 38 | 8/30/2026 |
| 4.0.388 | 37 | 8/29/2026 |
| 4.0.387 | 197 | 8/29/2026 |
| 4.0.386 | 577 | 8/26/2026 |
| 4.0.385 | 354 | 8/26/2026 |
| 4.0.384 | 141 | 8/26/2026 |
| 4.0.383 | 264 | 8/25/2026 |
| 4.0.382 | 495 | 8/22/2026 |
| 4.0.381 | 91 | 8/22/2026 |
| 4.0.380 | 248 | 8/21/2026 |
| 4.0.379 | 82 | 8/21/2026 |
Isolate Cloudflare HTTP client cache ownership