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
                    
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.Apollo.HttpClients" Version="11.0.89" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Apollo.HttpClients" Version="11.0.89" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Apollo.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.Apollo.HttpClients --version 11.0.89
                    
#r "nuget: Soenneker.Apollo.HttpClients, 11.0.89"
                    
#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.Apollo.HttpClients@11.0.89
                    
#: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.Apollo.HttpClients&version=11.0.89
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Apollo.HttpClients&version=11.0.89
                    
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.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 TryAdd for 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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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.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
Loading failed

Remove redundant framework conditions