Soenneker.Apollo.HttpClients
11.0.89
Prefix Reserved
dotnet add package Soenneker.Apollo.HttpClients --version 11.0.89
NuGet\Install-Package Soenneker.Apollo.HttpClients -Version 11.0.89
<PackageReference Include="Soenneker.Apollo.HttpClients" Version="11.0.89" />
<PackageVersion Include="Soenneker.Apollo.HttpClients" Version="11.0.89" />
<PackageReference Include="Soenneker.Apollo.HttpClients" />
paket add Soenneker.Apollo.HttpClients --version 11.0.89
#r "nuget: Soenneker.Apollo.HttpClients, 11.0.89"
#:package Soenneker.Apollo.HttpClients@11.0.89
#addin nuget:?package=Soenneker.Apollo.HttpClients&version=11.0.89
#tool nuget:?package=Soenneker.Apollo.HttpClients&version=11.0.89
Soenneker.Apollo.HttpClients
A cached, authenticated HttpClient provider for Apollo's REST API.
This is the HTTP transport layer used by Soenneker.Apollo.OpenApiClientUtil. Most applications that want the generated, typed Apollo API should register that higher-level package instead. Use this package directly when you need the configured HttpClient itself.
Installation
dotnet add package Soenneker.Apollo.HttpClients
Configuration
Add the Apollo API key to configuration:
{
"Apollo": {
"ApiKey": "your-api-key"
}
}
The available keys are:
| Key | Required | Default | Purpose |
|---|---|---|---|
Apollo:ApiKey |
Yes | — | Value used to authenticate requests. |
Apollo:ClientBaseUrl |
No | https://api.apollo.io/api/v1 |
Overrides the Apollo API base address. |
Apollo:AuthHeaderName |
No | x-api-key |
Changes the authentication header name. |
Apollo:AuthHeaderValueTemplate |
No | {token} |
Formats the header value; {token} is replaced with the configured API key. |
For example, a bearer-style gateway can be configured with an Authorization header and a Bearer {token} template.
Keep API keys in user secrets, environment variables, or a secret store rather than committing them to appsettings.json.
Registration and usage
using Soenneker.Apollo.HttpClients.Registrars;
builder.Services.AddApolloOpenApiHttpClientAsSingleton();
Inject the abstraction and retrieve the cached client:
using Soenneker.Apollo.HttpClients.Abstract;
public sealed class ApolloTransportProbe
{
private readonly IApolloOpenApiHttpClient _clientProvider;
public ApolloTransportProbe(IApolloOpenApiHttpClient clientProvider)
{
_clientProvider = clientProvider;
}
public async ValueTask<Uri?> GetBaseAddress(
CancellationToken cancellationToken)
{
HttpClient client = await _clientProvider.Get(cancellationToken);
return client.BaseAddress;
}
}
Get creates the client on first use and returns the same cached instance afterward. The client has its BaseAddress and authentication header configured from IConfiguration.
Scoped registration is available, but the underlying HTTP client cache remains a singleton:
builder.Services.AddApolloOpenApiHttpClientAsScoped();
Lifetime behavior
- Reuse the returned client; do not dispose it after individual requests.
- Configuration is evaluated when the cached client is created. Changing configuration does not mutate an already-created client.
- Let the dependency-injection container dispose
IApolloOpenApiHttpClient. Disposal removes and disposes its named client from the shared cache. - The registration methods use
TryAddfor the provider, so an application-supplied implementation is preserved.
For typed endpoint methods and generated response models, use Soenneker.Apollo.OpenApiClientUtil.
API
| Method | Purpose |
|---|---|
IApolloOpenApiHttpClient.Get(CancellationToken) |
Returns the cached, configured Apollo HttpClient. |
AddApolloOpenApiHttpClientAsSingleton() |
Registers the provider application-wide. |
AddApolloOpenApiHttpClientAsScoped() |
Registers a scoped provider backed by the shared client cache. |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Extensions.Configuration (>= 11.0.914)
- Soenneker.Utils.HttpClientCache (>= 11.0.2139)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Apollo.HttpClients:
| Package | Downloads |
|---|---|
|
Soenneker.Apollo.OpenApiClientUtil
A thread-safe utility for obtaining Apollo's OpenApiClient singleton. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.89 | 0 | 10/27/2026 |
| 11.0.88 | 4 | 10/27/2026 |
| 11.0.87 | 48 | 10/26/2026 |
| 11.0.86 | 49 | 10/26/2026 |
| 11.0.85 | 50 | 10/26/2026 |
| 4.0.84 | 187 | 10/15/2026 |
| 4.0.83 | 88 | 10/15/2026 |
| 4.0.82 | 109 | 10/14/2026 |
| 4.0.78 | 115 | 10/14/2026 |
| 4.0.72 | 100 | 10/13/2026 |
| 4.0.71 | 84 | 10/13/2026 |
| 4.0.69 | 125 | 10/12/2026 |
| 4.0.68 | 114 | 10/12/2026 |
| 4.0.67 | 120 | 10/11/2026 |
| 4.0.66 | 83 | 10/11/2026 |
| 4.0.65 | 135 | 10/9/2026 |
| 4.0.64 | 136 | 10/1/2026 |
| 4.0.63 | 127 | 9/29/2026 |
| 4.0.62 | 107 | 9/29/2026 |
| 4.0.61 | 115 | 9/26/2026 |
Remove redundant framework conditions