Soenneker.Docker.Hub.HttpClients 4.0.61

Prefix Reserved
dotnet add package Soenneker.Docker.Hub.HttpClients --version 4.0.61
                    
NuGet\Install-Package Soenneker.Docker.Hub.HttpClients -Version 4.0.61
                    
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.Docker.Hub.HttpClients" Version="4.0.61" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Docker.Hub.HttpClients" Version="4.0.61" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Docker.Hub.HttpClients" />
                    
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.Docker.Hub.HttpClients --version 4.0.61
                    
#r "nuget: Soenneker.Docker.Hub.HttpClients, 4.0.61"
                    
#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.Docker.Hub.HttpClients@4.0.61
                    
#: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.Docker.Hub.HttpClients&version=4.0.61
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Docker.Hub.HttpClients&version=4.0.61
                    
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.Docker.Hub.HttpClients

Provides a cached HttpClient configured for the Docker Hub API and bearer authentication.

Installation

dotnet add package Soenneker.Docker.Hub.HttpClients

Configuration

{
  "DockerHub": {
    "AccessToken": "your-access-token"
  }
}

Keep the token in a secret provider rather than source control.

The transport can also be customized with these optional settings:

{
  "Hub": {
    "ClientBaseUrl": "https://hub.docker.com",
    "AuthHeaderName": "Authorization",
    "AuthHeaderValueTemplate": "Bearer {token}"
  }
}

The template replaces every literal {token} with DockerHub:AccessToken. Treat the base URL, header name, and template as trusted configuration because they determine where and how the credential is sent.

Registration and use

using Soenneker.Docker.Hub.HttpClients.Abstract;
using Soenneker.Docker.Hub.HttpClients.Registrars;

services.AddDockerHubOpenApiHttpClientAsSingleton();

public sealed class DockerHubTransport(IDockerHubOpenApiHttpClient clientProvider)
{
    public async Task<HttpResponseMessage> Send(
        HttpRequestMessage request,
        CancellationToken cancellationToken)
    {
        HttpClient client = await clientProvider.Get(cancellationToken);
        return await client.SendAsync(request, cancellationToken);
    }
}

Get returns the cached client. Do not dispose the returned HttpClient; the registered provider owns the cache entry.

Singleton registration is the normal choice for direct transport use. AddDockerHubOpenApiHttpClientAsScoped() creates a separately owned cache entry for each scope, so disposing one provider cannot remove another provider's client.

This package only configures transport. It does not deserialize responses, paginate results, or convert non-success status codes into domain exceptions. Use the companion OpenAPI client utility when you want the generated Docker Hub API surface.

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 (1)

Showing the top 1 NuGet packages that depend on Soenneker.Docker.Hub.HttpClients:

Package Downloads
Soenneker.Docker.Hub.OpenApiClientUtil

Provides a cached Docker Hub OpenAPI client backed by the configured Docker Hub HttpClient.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.61 65 10/1/2026
4.0.60 90 9/29/2026
4.0.59 86 9/29/2026
4.0.58 103 9/26/2026
4.0.57 97 9/25/2026
4.0.56 98 9/25/2026
4.0.55 86 9/24/2026
4.0.54 163 9/17/2026
4.0.53 102 9/16/2026
4.0.52 100 9/16/2026
4.0.51 102 9/16/2026
4.0.50 91 9/16/2026
4.0.49 126 9/15/2026
4.0.48 86 9/15/2026
4.0.47 95 9/15/2026
4.0.46 122 9/13/2026
4.0.45 106 9/13/2026
4.0.44 104 9/13/2026
4.0.43 109 9/13/2026
4.0.42 113 9/12/2026
Loading failed