Soenneker.Bandwidth.HttpClients 4.0.163

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

Provides a cached, authenticated HttpClient for the Bandwidth OpenAPI client.

Installation

dotnet add package Soenneker.Bandwidth.HttpClients

Configuration

{
  "Bandwidth": {
    "ApiKey": "your-token",
    "ClientBaseUrl": "https://api.bandwidth.com/api/v2/",
    "AuthHeaderName": "Authorization",
    "AuthHeaderValueTemplate": "Bearer {token}"
  }
}

Bandwidth:ApiKey is required. The other values shown are the defaults.

Bandwidth's combined API surface uses more than one authentication scheme. Set the header template for the particular service you call. For a Basic credential that has already been Base64-encoded, use Basic {token}. Endpoints requiring multiple credential headers need a separately configured Kiota authentication provider rather than this single-header transport wrapper.

Registration

using Soenneker.Bandwidth.HttpClients.Registrars;

services.AddBandwidthOpenApiHttpClientAsSingleton();

AddBandwidthOpenApiHttpClientAsScoped() is also available. Both registrations use the singleton HTTP-client cache.

Usage

using Soenneker.Bandwidth.HttpClients.Abstract;

public sealed class BandwidthTransport
{
    private readonly IBandwidthOpenApiHttpClient _clientProvider;

    public BandwidthTransport(IBandwidthOpenApiHttpClient clientProvider)
    {
        _clientProvider = clientProvider;
    }

    public async Task<HttpResponseMessage> Send(HttpRequestMessage request, CancellationToken cancellationToken = default)
    {
        HttpClient client = await _clientProvider.Get(cancellationToken);
        return await client.SendAsync(request, cancellationToken);
    }
}

Get() creates the named client on first use and returns it afterward. Configuration changes do not rebuild an existing client. Do not dispose the returned HttpClient per request. Disposing the provider removes and disposes its named client from the cache.

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

Package Downloads
Soenneker.Bandwidth.OpenApiClientUtil

A thread-safe utility for obtaining Bandwidth's OpenApiClient singleton.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.163 87 10/15/2026
4.0.162 82 10/15/2026
4.0.161 91 10/14/2026
4.0.160 94 10/14/2026
4.0.157 91 10/14/2026
4.0.150 103 10/13/2026
4.0.148 78 10/13/2026
4.0.146 117 10/12/2026
4.0.145 108 10/12/2026
4.0.144 110 10/12/2026
4.0.143 87 10/11/2026
4.0.142 118 10/11/2026
4.0.141 126 10/9/2026
4.0.140 152 10/1/2026
4.0.139 138 9/29/2026
4.0.138 109 9/29/2026
4.0.137 127 9/26/2026
4.0.136 127 9/25/2026
4.0.134 117 9/25/2026
4.0.132 111 9/24/2026
Loading failed

Updated NuGet packages