Singulink.Net.Http.Api.Client 2.0.2

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

Chat on Discord Build and Test

HTTP API Toolkit is a set of client and service libraries for building and consuming HTTP APIs in .NET based on a consistent set of opinionated conventions. A service and a client built with the toolkit agree on how sessions, errors, streamed results and SignalR hubs work, so application code deals with typed exceptions, typed hub contracts and plain IAsyncEnumerable<T> results instead of HTTP plumbing.

✔️ Cookie sessions validated without a store lookup
✔️ Session token rotation and theft detection
✔️ Errors travel as typed exceptions
✔️ Streamed results with keep-alive and error propagation
✔️ Strongly typed SignalR hub contracts
✔️ Runs on desktop, mobile and browser clients
✔️ Trimming and AOT friendly

Details of each component are provided below:

Library Status Package
Singulink.Net.Http.Api Public View nuget package
Singulink.Net.Http.Api.Client Public View nuget package
Singulink.Net.Http.Api.Client.SignalR Public View nuget package
Singulink.Net.Http.Api.Service Public View nuget package

Supported Runtimes: .NET 10.0+

Libraries may be in the following states:

  • Internal: Source code (and possibly a nuget package) is available but the library is intended for internal use at this time.
  • Preview: Library is available for public preview but the APIs may not be fully documented and the API surface is subject to change without notice.
  • Public: Library is intended for public use with a fully documented and stable API surface.

You are welcome to use any libraries or code in this repository that you find useful and feedback/contributions are appreciated regardless of library state.

We are a small team of engineers and designers dedicated to building beautiful, functional and well-engineered software solutions. We offer very competitive rates as well as fixed-price contracts and welcome inquiries to discuss any custom development / project support needs you may have.

These packages are part of our Singulink Libraries collection. Visit https://github.com/Singulink to see our full list of publicly available libraries and other open-source projects.

Components

Singulink.Net.Http.Api

Shared library referenced by both clients and services. It contains the parts of the conventions that both sides must agree on, and has no ASP.NET Core dependency so it can also be referenced by data contract and data layer projects:

  • The ApiException hierarchy (BadRequestApiException, UnauthorizedApiException, NotFoundApiException, ValidationApiException, ServerErrorApiException and more), thrown on the server and rethrown as the same type on the client.
  • The StreamingResponse format and reader for streamed results.
  • HubMessage, HubMethod and HubStream definitions for strongly typed SignalR hub contracts.
  • The ISessionData session record contract implemented by data layer projects.

Singulink.Net.Http.Api.Service

ASP.NET Core library for building services. Sessions are cookie-based and backed by an encrypted, self-contained session token, so most requests need no session store lookup. Sessions use a sliding expiry with periodic refresh, token rotation for theft detection and a grace window for concurrent requests, and security-sensitive operations can force validation so they always act on current data.

  • Cross-origin request blocking (CSRF protection) and a user ID precondition that catches stale clients after account switches.
  • Exceptions mapped to error responses through a single IApiExceptionHandler, with reference IDs logged and reported for unexpected failures.
  • Endpoints returning IAsyncEnumerable<T> automatically converted to flushed, keep-alive capable streams that propagate errors.
  • SignalR hub filter that reports hub exceptions to clients with the same typed errors as HTTP requests.

Singulink.Net.Http.Api.Client

Base class for API clients on any .NET platform, including browser (WebAssembly) and mobile apps:

  • Session cookie handling with persistence callbacks, so a signed-in session survives app restarts.
  • Automatic user ID preconditions on requests.
  • Error responses rethrown as typed ApiException instances.
  • Streamed results consumed as IAsyncEnumerable<T>.
  • Trimming and AOT friendly when used with a source-generated JSON serializer context.

Singulink.Net.Http.Api.Client.SignalR

Adds SignalR support to API clients:

  • Hub connections that share the client's session and always present the current session token, including on reconnect.
  • ApiHubConnection with a strongly typed message, method and stream API based on shared contract definitions.
  • Hub errors surfaced as the same typed ApiException instances as HTTP requests.

Further Reading

You can view the full documentation, including guides and API documentation, on the project documentation site.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Singulink.Net.Http.Api.Client:

Package Downloads
Singulink.Net.Http.Api.Client.SignalR

SignalR client library for the Singulink HTTP API Toolkit.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 0 9/5/2026
2.0.1 29 9/4/2026
1.14.1 105 8/28/2026
1.14.0 170 7/22/2026
1.13.0 151 6/16/2026
1.12.0 133 5/13/2026
1.11.0 124 5/13/2026
1.10.2 146 2/20/2026
1.10.1 140 2/20/2026
1.10.0 137 2/16/2026
1.9.0 125 2/15/2026
1.8.1 139 12/31/2025
1.8.0 132 12/31/2025
1.7.2 135 12/27/2025
1.7.1 122 12/27/2025
1.7.0 128 12/27/2025
1.6.0 221 12/25/2025
1.5.1 307 8/26/2025
1.5.0 217 8/25/2025
Loading failed