Bsft.Correlation.Http 2.1.0

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

Bsft.Correlation.Http

The outbound half of the Bsft.Correlation family: an HttpClient delegating handler that attaches the X-Correlation-Id of the current scope to every request it sends, so the next service continues the same trace instead of starting its own.

Install

dotnet add package Bsft.Correlation.Http

Requires Bsft.Correlation.Abstractions (pulled transitively) and Microsoft.Extensions.DependencyInjection.Abstractions for the entry point. No further Bsft packages, and no ASP.NET Core: this package is deliberately referenceable from a Blazor WebAssembly front end, a console tool or an integration-test client, and a test pins that closure. A host that also serves requests takes Bsft.Correlation, which references this package and registers the handler for you.

Register

services.AddBsftCorrelationHttp();

services.AddHttpClient<IBillingServiceClient, BillingServiceClient>()
    .AddHttpMessageHandler<CorrelationIdDelegatingHandler>();

Register it per client rather than globally, and only on clients that reach your own services. The handler attaches the header to whatever the client sends, a request following a redirect to another host included. The identifier is not a credential, but it says how a deployment traces itself, and a third party has no business reading that.

Nothing else is required. AddBsftCorrelationHttp() registers the handler and nothing more — it does not supply an ICorrelationContext, because where the ID comes from differs per host: a server gets it from AddBsftCorrelation() and its inbound middleware, a client registers its own implementation. The call is idempotent, so a host that calls AddBsftCorrelation() (which calls this) and this method itself still ends up with one handler registration.

Configure

Option Default Effect
— — No options type. The header name is fixed at CorrelationDefaults.CorrelationId (X-Correlation-Id) so that the middleware, this handler and every adapter package cannot disagree about it. An outbound request that already carries the header keeps its value.

Validation: none — there is nothing to configure and therefore nothing that can be misconfigured.

Extend

ICorrelationContext — declared in Bsft.Correlation.Abstractions, it is what the handler reads the outgoing ID from and the only seam involved. Bsft.Correlation supplies the request-scoped implementation for a server; a client that mints or receives its ID some other way implements the interface itself. CorrelationIdDelegatingHandler is sealed.

Documentation

Topic page: docs/correlation.md. Conventions: docs/package-conventions.md.

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 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 (2)

Showing the top 2 NuGet packages that depend on Bsft.Correlation.Http:

Package Downloads
Bsft.Correlation

BSFT Framework correlation ID tracking for ASP.NET Core

Bsft.Resilience

BSFT Framework resilience (retry, circuit breaker, timeout) for HTTP clients, built on Polly. The mediator retry behavior ships in Bsft.Resilience.Mediator.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.0 173 10/23/2026
2.1.0 240 9/28/2026