Genocs.Http
9.0.0-beta004
See the version list below for details.
Requires NuGet 5.0.0 or higher.
dotnet add package Genocs.Http --version 9.0.0-beta004
NuGet\Install-Package Genocs.Http -Version 9.0.0-beta004
<PackageReference Include="Genocs.Http" Version="9.0.0-beta004" />
<PackageVersion Include="Genocs.Http" Version="9.0.0-beta004" />
<PackageReference Include="Genocs.Http" />
paket add Genocs.Http --version 9.0.0-beta004
#r "nuget: Genocs.Http, 9.0.0-beta004"
#:package Genocs.Http@9.0.0-beta004
#addin nuget:?package=Genocs.Http&version=9.0.0-beta004&prerelease
#tool nuget:?package=Genocs.Http&version=9.0.0-beta004&prerelease
Genocs.Http

Http client abstractions and helpers for Genocs applications. Supports net10.0, net9.0, and net8.0.
Installation
dotnet add package Genocs.Http
Getting Started
Use this package to provide the base Http abstraction layer for outbound service calls and client configuration in Genocs services. Registration flows through Genocs.Core (IGenocsBuilder.AddHttpClient(...)).
Main Entry Points
AddHttpClient— registers a typedIHttpClient(GenocsHttpClient),HttpClientOptions, and the defaultSystemTextJsonHttpClientSerializer. Use the optionalhttpClientBuilderargument to callConfigureHttpClient(for example to setHttpClient.BaseAddressfor relative URI strings).
Response handling
- String URI, exception-oriented helpers —
GetAsync,PostAsync,GetAsync<T>,PostAsync<T>, and similar either returnHttpResponseMessageafter a successful status or throw when the status is not successful (typed methods deserialize only after success). - String URI, result-oriented helpers — Methods named
*ResultAsync<T>(string, ...)(for exampleGetResultAsync<T>,PostResultAsync<T>) returnHttpResult<T>for both success and failure status codes. InspectHttpResult<T>.Responsefor status and content; they do not throw solely because the HTTP status indicates an error. For non-success responses,Resultis typically the default value forT; useHasResultonly as a hint about a non-null deserialized payload. HttpRequestMessageoverloads —SendResultAsync<T>(HttpRequestMessage, ...)preserves non-success responses inHttpResult<T>.SendAsync<T>(HttpRequestMessage, ...)throws when the status is not successful (exception-oriented deserialization path). Request-message overloads send the providedHttpRequestMessageonce per call and do not internally retry by replaying that instance.- Response ownership — Typed methods that return
T?consume and dispose transientHttpResponseMessageinstances internally. Methods that returnHttpResponseMessageorHttpResult<T>transfer response ownership to the caller.
Retries
- Retries apply only to transport-level transient failures during send (for example
HttpRequestExceptionwithout a response status, retryableHttpRequestExceptionstatus codes, andIOException). - Retries apply to string-URI helper methods.
HttpRequestMessageoverloads intentionally do not replay the same message instance. - Cancellation-driven failures are not retried. User-triggered cancellation is surfaced immediately as
OperationCanceledException/TaskCanceledException. - HTTP error status codes are not retried by default. Exception-oriented methods still throw on non-success responses, but that happens after the retry boundary.
- Deserialization failures are not retried.
- By default, retries are limited to idempotent methods.
POST,PUT, andPATCHare excluded unless explicitly enabled. - Configure retry count via
httpClient.retriesand opt-in write-method retries viahttpClient.retryUnsafeHttpMethodsinHttpClientOptions. - Cancellation tokens are propagated through send, response-stream access, and payload deserialization paths.
Request URIs and BaseAddress
Request URI strings are parsed with
System.Uri(UriKind.RelativeOrAbsolute) after trimming. Null, whitespace-only, or unparseable values throwArgumentExceptionwith parameter nameuri.Pass absolute URIs (for example
https://api.contoso.com/v1/items) when you want a fully qualified destination; they are sent unchanged (no scheme or host rewriting).Pass relative paths (for example
items/5or/items/5) when the namedHttpClienthas aBaseAddressset, for example:AddHttpClient(..., httpClientBuilder: b => b.ConfigureHttpClient(c => c.BaseAddress = new Uri("https://api.contoso.com/v1/")))Resolution follows normal
HttpClient/Uricombination rules. Prefer aBaseAddressthat ends with/when you want relative segments to append as subpaths predictably.The client does not prepend
http://or guess a scheme for host-like strings. Upgrade note: older versions prependedhttp://when the string did not start withhttp; that behavior was removed. Use an absolute URI, or setBaseAddressand pass relative paths.If you use a relative URI without
BaseAddress,HttpClientfails when sending (for exampleInvalidOperationException); configure the base address explicitly rather than relying on implicit rewriting.
Further documentation
- Agent-oriented reference (semantics, recipes, troubleshooting): Genocs.Http-Agent-Documentation.md
- Implementation backlog and roadmap: Genocs.Http-Implementation-Backlog.md
Support
- Documentation Portal: https://learn.fiscanner.net/
- Documentation: https://github.com/Genocs/genocs-library/tree/main/docs
- Repository: https://github.com/Genocs/genocs-library
Release Notes
| Product | Versions 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 is compatible. 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. |
-
net10.0
- Genocs.Core (>= 9.0.0-beta004)
- Microsoft.Extensions.Http (>= 10.0.6)
- Polly (>= 8.6.6)
-
net8.0
- Genocs.Core (>= 9.0.0-beta004)
- Microsoft.Extensions.Http (>= 10.0.6)
- Polly (>= 8.6.6)
-
net9.0
- Genocs.Core (>= 9.0.0-beta004)
- Microsoft.Extensions.Http (>= 10.0.6)
- Polly (>= 8.6.6)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Genocs.Http:
| Package | Downloads |
|---|---|
|
Genocs.Discovery.Consul
Consul-based service discovery integration for Genocs applications. |
|
|
Genocs.ServiceDiscovery.Consul
Consul-based service discovery integration for Genocs applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.0 | 166 | 5/21/2026 |
| 9.0.0-beta009 | 178 | 5/11/2026 |
| 9.0.0-beta008 | 207 | 5/2/2026 |
| 9.0.0-beta007 | 170 | 4/29/2026 |
| 9.0.0-beta006 | 155 | 4/27/2026 |
| 9.0.0-beta005 | 167 | 4/26/2026 |
| 9.0.0-beta004 | 159 | 4/18/2026 |
| 9.0.0-beta003 | 186 | 4/5/2026 |
| 9.0.0-beta002 | 211 | 3/17/2026 |
| 9.0.0-beta001 | 188 | 2/28/2026 |
| 8.1.0 | 230 | 2/8/2026 |
| 8.0.0 | 2,688 | 11/23/2025 |
| 7.5.1 | 2,719 | 10/19/2025 |
| 7.5.0 | 5,410 | 10/12/2025 |
| 7.4.1 | 2,109 | 9/19/2025 |
| 7.4.0 | 374 | 9/19/2025 |
| 7.3.0 | 8,461 | 8/14/2025 |
| 7.2.5 | 13,784 | 5/1/2025 |
| 7.2.4 | 2,286 | 4/18/2025 |
| 7.2.3 | 17,340 | 1/20/2025 |
The change log and breaking changes are listed here.
https://github.com/Genocs/genocs-library/releases