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
<PackageReference Include="Soenneker.DigitalOcean.HttpClients" Version="4.0.64" />
<PackageVersion Include="Soenneker.DigitalOcean.HttpClients" Version="4.0.64" />
<PackageReference Include="Soenneker.DigitalOcean.HttpClients" />
paket add Soenneker.DigitalOcean.HttpClients --version 4.0.64
#r "nuget: Soenneker.DigitalOcean.HttpClients, 4.0.64"
#:package Soenneker.DigitalOcean.HttpClients@4.0.64
#addin nuget:?package=Soenneker.DigitalOcean.HttpClients&version=4.0.64
#tool nuget:?package=Soenneker.DigitalOcean.HttpClients&version=4.0.64
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 | 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.898)
- Soenneker.Utils.HttpClientCache (>= 4.0.2101)
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 |