EllipticBit.Coalescence.Request
1.5.6
dotnet add package EllipticBit.Coalescence.Request --version 1.5.6
NuGet\Install-Package EllipticBit.Coalescence.Request -Version 1.5.6
<PackageReference Include="EllipticBit.Coalescence.Request" Version="1.5.6" />
<PackageVersion Include="EllipticBit.Coalescence.Request" Version="1.5.6" />
<PackageReference Include="EllipticBit.Coalescence.Request" />
paket add EllipticBit.Coalescence.Request --version 1.5.6
#r "nuget: EllipticBit.Coalescence.Request, 1.5.6"
#:package EllipticBit.Coalescence.Request@1.5.6
#addin nuget:?package=EllipticBit.Coalescence.Request&version=1.5.6
#tool nuget:?package=EllipticBit.Coalescence.Request&version=1.5.6
EllipticBit.Coalescence.Request
HTTP client transport library for the Coalescence code generation system.
This package provides a fluent, options-driven HTTP request pipeline built on top of IHttpClientFactory. It is the client-side runtime used by Coalescence-generated Web API clients, but it can also be used directly to build and send HTTP requests with pluggable serialization, authentication, automatic retries, and optional Zstandard (zstd) compression.
Features
- Fluent request builder:
CreateRequest(name).Get()/Post()/Put()/Patch()/Delete()/Head(). - Named configuration via
CoalescenceRequestOptions(HttpClient id, retry count, retry delay, date formatting, default authentication scheme, error handling). - Integrates with
IHttpClientFactorynamed clients. - Pluggable JSON/XML serialization inherited from
EllipticBit.Coalescence.Shared. - Built-in retry with configurable count and delay.
- Optional zstd request/response compression via
ZStdDelegatingHandler.
Requirements
- Targets
.NET Standard 2.0, so it runs on .NET Framework 4.6.1+, .NET Core 2.0+, and modern .NET (.NET 8+).
Installation
Install from NuGet:
dotnet add package EllipticBit.Coalescence.Request
Or add a PackageReference to your project file (replace the version with the latest published version):
<PackageReference Include="EllipticBit.Coalescence.Request" Version="x.y.z" />
Getting Started
1. Register the services
AddCoalescenceRequestServices() registers the request factory, while AddCoalescenceRequestOptions(...) (an extension on the shared ICoalescenceServiceBuilder) registers one or more named option sets. Each option set is bound to a named HttpClient.
using EllipticBit.Coalescence.Request;
using EllipticBit.Coalescence.Shared;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
// Register a named HttpClient that the request options will use.
services.AddHttpClient("example-api", client =>
{
client.BaseAddress = new Uri("https://api.example.com");
});
// Register the shared services + the named Coalescence request options.
services.AddCoalescenceServices()
.AddCoalescenceRequestOptions("example", new CoalescenceRequestOptions("example", "example-api")
{
MaxRetryCount = 3,
RetryDelay = 250
});
// Register the request factory.
services.AddCoalescenceRequestServices();
var provider = services.BuildServiceProvider();
2. Send a request
Resolve ICoalescenceRequestFactory and build a request fluently. The response is awaited and disposed asynchronously.
using EllipticBit.Coalescence.Shared.Request;
var factory = provider.GetRequiredService<ICoalescenceRequestFactory>();
// GET https://api.example.com with the default authentication scheme.
await using var response = await factory.CreateRequest("example")
.Get()
.Authentication()
.Send();
string body = await response.AsString();
3. POST/PUT/DELETE with a serialized body
var factory = provider.GetRequiredService<ICoalescenceRequestFactory>();
await using var response = await factory.CreateRequest("example")
.Post()
.Path("api", "v1", "contacts")
.Serialized(new Contact { Name = "Ada Lovelace", Email = "ada@example.com" })
.Send();
var created = await response.AsSerialized<Contact>();
Deserializing typed responses
ICoalescenceResponse exposes helpers such as AsString() and AsSerialized<T>() to read the response payload using the configured serializer.
Related Packages
| Package | Description |
|---|---|
EllipticBit.Coalescence.Shared |
Shared abstractions (pulled in automatically). |
EllipticBit.Coalescence.Request |
HTTP client transport (this package). |
EllipticBit.Coalescence.AspNetCore |
ASP.NET Core server-side support. |
EllipticBit.Coalescence.SignalR |
SignalR client transport support. |
License
Licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! To contribute:
- Fork the repository and create a feature branch.
- Make your changes, following the existing code style and conventions.
- Add or update tests where appropriate and ensure the solution builds.
- Open a merge/pull request with a clear description of the change and its motivation.
AI / LLM-assisted contributions
If any part of your contribution was generated with the assistance of a Large Language Model (LLM) or other generative AI tool, you must include the exact prompt(s) used to generate the contribution in the PROMPTS.txt file at the root of the repository. Append each prompt along with a short note describing what it produced. Pull requests containing LLM-generated content without the corresponding prompts will not be accepted.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- EllipticBit.Coalescence.Shared (>= 1.5.6)
- EllipticBit.Extensions (>= 1.1.8)
- Microsoft.AspNet.WebApi.Client (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Http (>= 10.0.9)
- System.Collections.Immutable (>= 10.0.9)
- ZstdSharp.Port (>= 0.8.8)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on EllipticBit.Coalescence.Request:
| Package | Downloads |
|---|---|
|
EllipticBit.Services.Address.USPS
USPS address validation and standardization provider for the EllipticBit Services address abstractions, including a configured HTTP client and response caching. |
|
|
EllipticBit.PartsTech.Client
Client library for the PartsTech API. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.6 | 189 | 6/23/2026 |
| 1.5.5 | 102 | 6/23/2026 |
| 1.5.4 | 205 | 5/9/2026 |
| 1.5.3 | 258 | 10/28/2025 |
| 1.5.2 | 351 | 5/30/2025 |
| 1.5.1 | 693 | 3/26/2025 |
| 1.5.0 | 303 | 3/10/2025 |
| 1.4.0 | 282 | 3/3/2025 |
| 1.3.9 | 239 | 1/29/2025 |
| 1.3.8 | 239 | 11/16/2024 |
| 1.3.7 | 250 | 10/9/2024 |
| 1.3.6 | 246 | 10/9/2024 |
| 1.3.5 | 249 | 9/24/2024 |
| 1.3.4 | 227 | 9/23/2024 |
| 1.3.3 | 225 | 9/23/2024 |
| 1.3.2 | 220 | 9/23/2024 |
| 1.3.1 | 254 | 9/12/2024 |
| 1.3.0 | 263 | 8/12/2024 |
| 1.2.5 | 268 | 5/10/2024 |
| 1.2.4 | 231 | 5/1/2024 |