Soenneker.Cloudflare.HttpClient 4.0.519

Prefix Reserved
dotnet add package Soenneker.Cloudflare.HttpClient --version 4.0.519
                    
NuGet\Install-Package Soenneker.Cloudflare.HttpClient -Version 4.0.519
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Cloudflare.HttpClient" Version="4.0.519" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Cloudflare.HttpClient" Version="4.0.519" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Cloudflare.HttpClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Cloudflare.HttpClient --version 4.0.519
                    
#r "nuget: Soenneker.Cloudflare.HttpClient, 4.0.519"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Cloudflare.HttpClient@4.0.519
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Cloudflare.HttpClient&version=4.0.519
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Cloudflare.HttpClient&version=4.0.519
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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. Remove(apiKey) or RemoveSync(apiKey) removes and disposes that token's client immediately. Otherwise, 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.Cloudflare.HttpClient:

Package Downloads
Soenneker.Cloudflare.Utils.Client

Thread-safe caching and configuration for generated Cloudflare OpenAPI clients.

Soenneker.Cloudflare.K2

Cloudflare K2 stream administration, typed publishing, and subscription processing with renewable batch leases.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.519 862 10/15/2026
4.0.518 88 10/15/2026
4.0.517 107 10/14/2026
4.0.516 189 10/14/2026
4.0.513 360 10/14/2026
4.0.512 326 10/14/2026
4.0.510 84 10/14/2026
4.0.509 79 10/14/2026
4.0.501 329 10/13/2026
4.0.499 91 10/13/2026
4.0.498 86 10/13/2026
4.0.495 495 10/12/2026
4.0.494 466 10/12/2026
4.0.492 990 10/12/2026
4.0.491 105 10/12/2026
4.0.490 209 10/11/2026
4.0.489 79 10/11/2026
4.0.488 1,574 10/9/2026
4.0.487 1,801 10/1/2026
4.0.486 801 9/29/2026
Loading failed

Updated NuGet packages