Soenneker.SendGrid.HttpClients 11.0.158

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

alternate text is missing from this package README image Soenneker.SendGrid.HttpClients

Provides a cached HttpClient for SendGrid mail, contacts, lists, templates, suppressions, statistics, settings, webhooks, and account APIs.

Installation

dotnet add package Soenneker.SendGrid.HttpClients

Configuration

{
  "SendGrid": {
    "ApiKey": "SG.xxxxxxxxx"
  }
}

Usage

using Soenneker.SendGrid.HttpClients.Abstract;
using Soenneker.SendGrid.HttpClients.Registrars;

services.AddSendGridOpenApiHttpClientAsSingleton();

public sealed class SendGridScopeReader
{
    private readonly ISendGridOpenApiHttpClient _sendGrid;

    public SendGridScopeReader(ISendGridOpenApiHttpClient sendGrid)
    {
        _sendGrid = sendGrid;
    }

    public async Task<string> GetScopes(CancellationToken cancellationToken)
    {
        HttpClient client = await _sendGrid.Get(cancellationToken);
        return await client.GetStringAsync("v3/scopes", cancellationToken);
    }
}

The provider sends Authorization: Bearer <api-key> and targets https://api.sendgrid.com/. SendGrid:ClientBaseUrl, SendGrid:AuthHeaderName, and SendGrid:AuthHeaderValueTemplate can override those defaults for a proxy or compatible service; use {token} in the value template where the configured key should be inserted.

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

Package Downloads
Soenneker.SendGrid.OpenApiClientUtil

Provides a lazily initialized, authenticated SendGrid v3 API client.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.166 142 11/3/2026
11.0.165 83 11/3/2026
11.0.164 108 11/3/2026
11.0.163 91 11/3/2026
11.0.162 105 11/3/2026
11.0.161 314 10/27/2026
11.0.160 129 10/27/2026
11.0.159 124 10/26/2026
11.0.158 110 10/26/2026
11.0.157 96 10/26/2026
4.0.156 147 10/15/2026
4.0.155 98 10/15/2026
4.0.154 93 10/14/2026
4.0.152 121 10/14/2026
4.0.151 88 10/14/2026
4.0.150 107 10/14/2026
4.0.144 108 10/13/2026
4.0.143 97 10/13/2026
4.0.139 141 10/12/2026
4.0.138 115 10/12/2026
Loading failed

Update dependency Soenneker.Extensions.Configuration to 11.0.914 (#314)