ForEach.Routing.Http 0.1.0

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

ForEach.Routing.Http

The HTTP implementation of IRoutingClient (package ForEach.Routing.Abstractions): a Refit client to a routing host that serves the wire contract of the abstractions package, with a service token and a resilience pipeline.

services.AddRoutingHttp(options =>
{
    options.BaseUrl = "https://routing.example.com";
    options.Auth.Authority = "https://auth.example.com";
    options.Auth.ClientId = "my-service";
    options.Auth.ClientSecret = secret;
    options.Auth.Scope = "routing";
});

// ...
RoutingResult<RouteResponseDto> result = await client.GetRouteAsync(request, ct);
Member What it does
AddRoutingHttp Registers IRoutingClient (scoped), the token provider and two named HttpClients. Binds nothing: the host sets RoutingHttpOptions in the delegate, from a configuration section or from an IConfigureOptions. Options are read per call, so a changed value needs no restart.
RoutingHttpOptions BaseUrl, AttemptTimeoutSeconds (30), TotalTimeoutSeconds (60), OptimizeTimeoutSeconds (120) and Auth (Authority, ClientId, ClientSecret, Scope).
  • Service token. OAuth client-credentials at {Auth.Authority}/connect/token, cached until 60 seconds before it expires, one request at a time. A 401 from the routing host drops the cached token.
  • Resilience. Route, table, nearest, trip, geocode and info are read-only computations, so each is idempotent and may be retried (twice, exponential backoff with jitter): no connection, a timeout, 408, 429, 502 and 504 are retried; 500 and 503 are not. A circuit breaker opens at 90% failures over at least 5 calls. The two calls that hand the host a problem to solve (OptimizeAsync, StartOptimizationJobAsync) have a pipeline of their own: one attempt with OptimizeTimeoutSeconds, never retried, and a circuit breaker a slow solve cannot open for the others.
  • Results, not exceptions. 400 is RoutingFailureKind.Invalid and 404 is NotFound, both with the host's message. 502, 503, 504, 401, 403, no connection, a timeout, an open circuit, no service token and a missing or invalid BaseUrl are Unavailable; 401/403 and the configuration cases are logged as errors, because they are a deployment fault. Anything else is Unexpected. A cancellation by the caller propagates.
  • Nothing personal in the logs. Requests and answers carry addresses and locations that can be homes: only the call name and the status are logged.
  • No kill switch. Whether to call the host at all is the application's decision; the client sends whenever it is called.

Targets net8.0 and net10.0. Dependencies: ForEach.Routing.Abstractions, Microsoft.Extensions.Http, Microsoft.Extensions.Http.Resilience, Refit and Refit.HttpClientFactory. Source and release notes: https://github.com/foreach-rs/nuget-releases/tree/main/packages/Routing

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

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
0.1.0 51 11/20/2026