ReadableHttp.AspNetCore
2.1.0
dotnet add package ReadableHttp.AspNetCore --version 2.1.0
NuGet\Install-Package ReadableHttp.AspNetCore -Version 2.1.0
<PackageReference Include="ReadableHttp.AspNetCore" Version="2.1.0" />
<PackageVersion Include="ReadableHttp.AspNetCore" Version="2.1.0" />
<PackageReference Include="ReadableHttp.AspNetCore" />
paket add ReadableHttp.AspNetCore --version 2.1.0
#r "nuget: ReadableHttp.AspNetCore, 2.1.0"
#:package ReadableHttp.AspNetCore@2.1.0
#addin nuget:?package=ReadableHttp.AspNetCore&version=2.1.0
#tool nuget:?package=ReadableHttp.AspNetCore&version=2.1.0
ReadableHttp.AspNetCore
.NET 10 dependency injection and IHttpClientFactory integration for ReadableHttp. Works with ASP.NET Core and other hosts using Microsoft.Extensions.DependencyInjection.
dotnet add package ReadableHttp.AspNetCore --version 2.1.0
Default client
using ReadableHttp.AspNetCore;
builder.Services.AddReadableHttp(client =>
{
client.BaseAddress = new Uri("https://api.example.com/");
client.Timeout = TimeSpan.FromSeconds(30);
});
Inject IReadableHttpExecutor for the default client, or IReadableHttpFactory to select named clients. Existing SendAsync(request, context, token) and SendExchangeAsync model APIs remain available.
Named fluent requests
using ReadableHttp;
using ReadableHttp.AspNetCore;
builder.Services.AddReadableHttpClient("billing", client =>
{
client.BaseAddress = new Uri("https://billing.example.com/");
});
app.MapGet("/invoices/{id}", async (
string id, IReadableHttpFactory factory, CancellationToken cancellationToken) =>
await factory.Request("invoices/{id}", "billing")
.WithPathParameter("id", id)
.SendAsync<InvoiceDto>(cancellationToken));
AddReadableHttpClient returns IHttpClientBuilder, so handler configuration can be chained. The SDK registration disables automatic redirects and cookie storage on the standard primary handler. This keeps SDK redirect handling active and avoids pooled cookie state between requests. If you replace the primary handler afterward, configure these policies on your replacement.
For existing AddHttpClient(name) registrations, call factory.CreateExecutor(name) or factory.Request(url, name). Their handler configuration remains application-owned; disable automatic redirects for SDK redirect tracking and credential handling. Proxy/TLS/cookie options in an execution context do not reconfigure an external handler.
The factory creates and disposes an HttpClient per call while IHttpClientFactory pools handlers. Configure credentials per request instead of DefaultRequestHeaders when following cross-origin redirects. SendAsync throws ReadableHttpException on HTTP/transport failures; SendExchangeAsync retains the response and error. Cancellation continues to propagate. Streaming is available on the same fluent builder.
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.Http (>= 9.0.0)
- ReadableHttp (>= 2.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.