Sunmeat.Nexus 1.0.0

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

Sunmeat.Nexus logo

Sunmeat.Nexus

Connect anything. Simplify everything.

NuGet CI MIT

Українська

Installation and quick start

The package targets .NET 8, 9, 10, and 11. The installation command applies after publication.

dotnet add package Sunmeat.Nexus --version 1.0.0

Start the local demonstration API in a separate terminal.

dotnet run --project examples/LocalApi
using Sunmeat.Nexus;

var users = await Nexus.GetAsync<User[]>("http://127.0.0.1:5078/users");

using var client = new NexusClient(new Uri("http://127.0.0.1:5078/"));
var activeUsers = await client.Request("users")
    .Query("active", true)
    .Timeout(TimeSpan.FromSeconds(10))
    .Retry(2)
    .GetAsync<User[]>();

Console.WriteLine($"{users.Length} users, {activeUsers.Length} active.");
await client.Request("files/example.txt").DownloadAsync("example.txt", overwrite: true);

internal sealed record User(string Name, bool Active);

HTTP API

Nexus.Request and NexusClient.Request create mutable request builders. Reuse the client and create a separate builder for each concurrent operation.

  • GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, and custom methods through Method.
  • JSON, text, URL-encoded forms, multipart, and custom INexusSerializer support.
  • Bearer, Basic, and header-based API key authentication.
  • ReadAsync<T>, ReadStringAsync, and ReadBytesAsync enforce a buffer limit.
  • SendAsync returns a caller-owned response. Its timeout covers headers. The caller controls cancellation and limits while reading the content.
  • CopyToAsync and DownloadAsync stream data and report bytes transferred. Downloads move the temporary file into place after transfer succeeds.
  • StreamJsonLinesAsync<T> reads NDJSON incrementally with a per-record size limit.
  • Retry allows up to five additional attempts for GET, HEAD, and OPTIONS without a request body.
  • PaginateAsync limits pages and tracks repeated URLs. The fetch callback is responsible for validating the origin of next-page URLs.
  • The default transport validates TLS certificates, pools connections, and disables automatic redirects. An injected HttpClient uses its own policies.
  • HttpVersion configures HTTP/1.1, HTTP/2, or HTTP/3 according to platform, transport, and server capabilities.

Cache and integration

NexusPublicCache is an opt-in in-memory cache for unauthenticated HTTPS GET requests without query strings. It accepts explicitly public responses with a freshness lifetime and skips responses containing Vary or Set-Cookie. Entries have a 256 KiB limit and a five-minute freshness cap. For custom conditional requests, use IfNoneMatch or IfModifiedSince with SendAsync.

NexusRateLimitHandler rejects excess requests without a queue. NexusDiagnosticsHandler emits status and elapsed time. Register them as delegating handlers with IHttpClientFactory, which also accepts custom middleware. NexusFakeHandler supports network-free HTTP tests. Nexus.ForEachAsync limits concurrency for asynchronous batches.

Local ASP.NET Core example

What's included

The single Sunmeat.Nexus package includes the HTTP API, WebSockets, SSE, OAuth 2.0, GraphQL, client generation from JSON OpenAPI, the C# generator for [NexusGet], HTML reports, Prism, Pulse and Vault adapters, and a Polly circuit breaker. NuGet restores the adapters' dependencies automatically. Run the CLI from the repository.

Module API, CLI, and compatibility

Build the package

Install a .NET 11 SDK that supports net11.0 and run from the repository root:

dotnet pack src/Sunmeat.Nexus/Sunmeat.Nexus.csproj -c Release -o artifacts

The library package is artifacts/Sunmeat.Nexus.1.0.0.nupkg. The build also produces Sunmeat.Nexus.1.0.0.snupkg with debugging symbols.

Sunmeat ecosystem

Prism · Pulse · Vault · Guard · Diff · Morph · Forge · Lens · Signal

Architecture and library comparison

❤️ Support the project

Support development Patreon Monobank Star on GitHub sunmeat.dev

Copyright © 2026 Oleksandr Zahoruiko · sunmeat.dev

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 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.  net11.0 is compatible. 
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
1.0.0 54 12/3/2026

Initial Sunmeat.Nexus package.