TCIS.Http 1.1.1

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

TCIS.Http

The core HTTP library of TCIS provides API calling mechanisms with automatic Context Propagation, Resilience (Polly v8 - Retry, Circuit Breaker, Timeout), Health Checks, and Dynamic Routing.

📦 Installation

dotnet add package TCIS.Http

🚀 Usage

1. Register HttpClient (Program.cs)

Use AddTHttpClient instead of .NET's AddHttpClient to apply standard TCIS enterprise practices:

using TCIS.Http.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Declare a standard Typed Client with Resilience Policies, Context Propagation, Latency Diagnostics, and Health Checks.
builder.Services.AddTHttpClient<IMyServiceClient, MyServiceClient>(client => 
{
    client.BaseAddress = new Uri("https://api.example.com");
}, healthPath: "/health/live");

var app = builder.Build();
app.Run();

2. Resilience Configuration in appsettings.json

The library supports automatic configuration binding from IConfiguration (Options section) with the following structure:

{
  "HttpResilience": {
    "MaxRetries": 3,
    "RetryDelayMilliseconds": 100,
    "CircuitBreakerFailures": 5,
    "CircuitBreakerBreakSeconds": 30,
    "TimeoutSeconds": 10
  }
}

3. Exceptions you must catch

With AddTResilienceHandler() (and therefore AddTHttpClient), a failed call does not always surface as HttpRequestException / TaskCanceledException:

Situation Exception
A single attempt exceeds TimeoutSeconds Polly.Timeout.TimeoutRejectedException
The circuit is open Polly.CircuitBreaker.BrokenCircuitException
Transport failure after the last retry HttpRequestException

TimeoutRejectedException and BrokenCircuitException share the base Polly.ExecutionRejectedException. Code that only catches HttpRequestException/TaskCanceledException lets them escape:

catch (Exception ex) when (ex is HttpRequestException or Polly.ExecutionRejectedException)
{
    throw new PartnerUnavailableException("…", ex);
}

Set HttpClient.Timeout = Timeout.InfiniteTimeSpan on such a client: HttpClient.Timeout covers the whole retry sequence and would cut it short; TimeoutSeconds bounds each attempt.

Retries apply to every HTTP method, POST included. Do not put AddTResilienceHandler() on a client that performs non-idempotent writes unless the partner deduplicates them.

⚙️ Core Components

  • AddTHttpClient<TClient, TImpl>: Initializes an Http Client accompanied by Polly v8 Resilience Handler, Context Propagation (propagates TenantId, CorrelationId), Latency Diagnostics, and Health Checks (Dependency).
  • AddTResilienceHandler: Automatically registers Retry, Circuit Breaker, and Timeout.
  • AddTContextPropagation: Registers TContextPropagationHandler to automatically attach IWorkContext information from the current Request to the Outgoing HTTP Headers.
  • AddTDynamicRouting<THandler>: Supports Dynamic Routing by passing a custom MessageHandler that inherits from TDynamicRoutingHandler.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on TCIS.Http:

Package Downloads
TCIS.Http.Grpc

TCIS Core Framework is an application framework for building modular, multi-tenant applications on ASP.NET Core. gRPC client and server integration for TCIS Framework.

TCIS.Http.RestEase

TCIS Core Framework is an application framework for building modular, multi-tenant applications on ASP.NET Core. RestEase client integration for TCIS Framework.

TCIS.Http.Refit

TCIS Core Framework is an application framework for building modular, multi-tenant applications on ASP.NET Core. Refit client integration for TCIS Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.2 0 11/10/2026
1.1.1 53 11/9/2026
1.1.0 61 11/7/2026
1.0.9 88 11/5/2026
1.0.9-rc.2 68 11/5/2026
1.0.9-rc.1 80 11/4/2026
1.0.8 132 11/3/2026
1.0.8-rc.11 85 10/30/2026
1.0.8-rc.10 83 10/30/2026
1.0.8-rc.9 86 10/30/2026
1.0.8-rc.8 84 10/29/2026
1.0.8-rc.7 86 10/27/2026
1.0.8-rc.6 90 10/27/2026
1.0.8-rc.5 91 10/23/2026
1.0.8-rc.4 92 10/23/2026
1.0.8-rc.3 88 10/23/2026
1.0.8-rc.2 93 10/22/2026
1.0.8-rc.1 89 10/22/2026
1.0.7 144 10/22/2026
1.0.6-rc.1 79 10/20/2026
Loading failed