Soenneker.DigitalOcean.HttpClients 4.0.64

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

Provides a cached HttpClient configured for DigitalOcean’s API base address and bearer authentication.

Installation

dotnet add package Soenneker.DigitalOcean.HttpClients

Configuration

{
  "DigitalOcean": {
    "AccessToken": "your-personal-access-token"
  }
}

Store the token in user secrets, environment-backed configuration, or a secret manager rather than source control.

Optional settings:

{
  "DigitalOcean": {
    "ClientBaseUrl": "https://api.digitalocean.com",
    "AuthHeaderName": "Authorization",
    "AuthHeaderValueTemplate": "Bearer {token}"
  }
}

The template replaces every literal {token} with AccessToken. Treat ClientBaseUrl, the header name, and the template as trusted configuration: the resulting authentication header is sent to that base address.

Registration and use

using Soenneker.DigitalOcean.HttpClients.Abstract;
using Soenneker.DigitalOcean.HttpClients.Registrars;

services.AddDigitalOceanOpenApiHttpClientAsSingleton();

public sealed class DropletReader(IDigitalOceanOpenApiHttpClient clientProvider)
{
    public async Task<string> GetDroplets(CancellationToken cancellationToken)
    {
        HttpClient client = await clientProvider.Get(cancellationToken);
        return await client.GetStringAsync("/v2/droplets", cancellationToken);
    }
}

Get returns the cached client; do not dispose that HttpClient yourself. The provider owns it and removes it from the cache when the provider is disposed.

AddDigitalOceanOpenApiHttpClientAsScoped() creates a separately owned cached client for each scope. Disposing a scope removes only that provider's client. Use singleton registration when one client should live for the application lifetime.

This package configures transport only. It does not deserialize DigitalOcean responses, follow pagination links, or translate non-success status codes. Use the companion OpenAPI client/util packages or handle those concerns in the caller.

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.DigitalOcean.HttpClients:

Package Downloads
Soenneker.DigitalOcean.OpenApiClientUtil

Provides a cached DigitalOcean OpenAPI client backed by the configured DigitalOcean HttpClient.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.64 65 10/1/2026
4.0.63 106 9/29/2026
4.0.62 79 9/29/2026
4.0.61 110 9/26/2026
4.0.60 107 9/25/2026
4.0.59 82 9/25/2026
4.0.58 96 9/25/2026
4.0.57 101 9/24/2026
4.0.56 184 9/17/2026
4.0.55 106 9/16/2026
4.0.54 79 9/16/2026
4.0.53 105 9/16/2026
4.0.52 107 9/16/2026
4.0.51 89 9/16/2026
4.0.50 124 9/15/2026
4.0.49 86 9/15/2026
4.0.48 122 9/13/2026
4.0.47 110 9/13/2026
4.0.46 105 9/13/2026
4.0.45 109 9/13/2026
Loading failed