Soenneker.Twilio.RestClient 4.0.2548

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

An async thread-safe singleton for a Twilio RestClient

Installation

dotnet add package Soenneker.Twilio.RestClient

Why?

This library provides a singleton of a TwilioRestClient.

Internally it implements an HttpClient singleton. This HttpClient has less overhead than new instances of HttpClient and IHttpClientFactory all while correctly handling connection pooling for DNS changes.

See soenneker.utils.httpclientcache for more information.

Usage

  1. Register ITwilioRestClientUtil with DI.
public static async Task Main(string[] args)
{
    ...
    builder.Services.AddTwilioRestClientUtilAsSingleton();
}
  1. Inject ITwilioRestClientUtil via constructor, and retrieve a TwilioRestClient.
public class TestClass
{
    ITwilioRestClientUtil _twilioRestClientUtil;

    public TestClass(ITwilioRestClientUtil twilioRestClientUtil)
    {
        _twilioRestClientUtil = twilioRestClientUtil;
    }

    public async ValueTask SendMessage()
    {
        var message = await MessageResource.CreateAsync(
            new PhoneNumber("+11234567890"),
            from: new PhoneNumber("+10987654321"),
            body: "Hello World!",
            client: await _twilioRestClientUtil.Get()
        );

        Console.WriteLine(message.Sid);
    }
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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2570 0 4/21/2026
4.0.2569 27 4/21/2026
4.0.2568 33 4/20/2026
4.0.2567 85 4/15/2026
4.0.2566 88 4/15/2026
4.0.2565 86 4/15/2026
4.0.2564 84 4/14/2026
4.0.2563 81 4/14/2026
4.0.2562 95 4/6/2026
4.0.2561 91 3/31/2026
4.0.2560 93 3/31/2026
4.0.2559 85 3/31/2026
4.0.2558 97 3/20/2026
4.0.2557 89 3/20/2026
4.0.2556 83 3/20/2026
4.0.2555 88 3/19/2026
4.0.2554 100 3/15/2026
4.0.2553 95 3/15/2026
4.0.2552 98 3/14/2026
4.0.2548 94 3/13/2026
Loading failed

Update dependency Soenneker.Extensions.Configuration to 4.0.804 (#2857)