![]() |
VOOZH | about |
dotnet add package Rystem.Api.Client --version 10.0.8
NuGet\Install-Package Rystem.Api.Client -Version 10.0.8
<PackageReference Include="Rystem.Api.Client" Version="10.0.8" />
<PackageVersion Include="Rystem.Api.Client" Version="10.0.8" />Directory.Packages.props
<PackageReference Include="Rystem.Api.Client" />Project file
paket add Rystem.Api.Client --version 10.0.8
#r "nuget: Rystem.Api.Client, 10.0.8"
#:package Rystem.Api.Client@10.0.8
#addin nuget:?package=Rystem.Api.Client&version=10.0.8Install as a Cake Addin
#tool nuget:?package=Rystem.Api.Client&version=10.0.8Install as a Cake Tool
Rystem.Api.Client is the runtime client layer for Rystem.Api.
It does not generate source files. Instead, it builds runtime DispatchProxy implementations for your interfaces and sends HTTP requests based on the shared endpoint metadata.
dotnet add package Rystem.Api.Client
The client package expects the same endpoint registrations that the server uses.
In practice, both sides should call a shared method, like the sample AddBusiness() in src/Api/Test/Rystem.Api.Test.Domain/ServiceCollectionExtensions.cs.
The flow is:
ConfigureEndpoints(...) and AddEndpoint...(...) registrations between client and serverAddClientsForAllEndpointsApi(...) or AddClientForEndpointApi<T>(...)IRequestEnhancer implementationsEach generated client is a transient factory-backed proxy that uses a named HttpClient internally.
This follows the sample app in src/Api/Test/Rystem.Api.TestClient/Program.cs.
builder.Services.AddBusiness();
builder.Services.AddClientsForAllEndpointsApi(http =>
{
http.ConfigurationHttpClientForApi(client =>
{
client.BaseAddress = new Uri("https://localhost:7117");
});
});
After that, you can inject the interface directly:
public sealed class ProductPage
{
private readonly ISalubry _service;
public ProductPage(ISalubry service)
=> _service = service;
public Task<bool> RunAsync(int id, Stream stream)
=> _service.GetAsync(id, stream);
}
| Method | Purpose |
|---|---|
AddClientsForAllEndpointsApi(Action<HttpClientBuilder>) |
register proxies for every endpoint currently known to EndpointsManager |
AddClientForEndpointApi<T>(Action<HttpClientBuilder>, factoryName?) |
register a proxy for one endpoint type, optionally targeting a named instance |
Generated proxies are registered through the same factory system used elsewhere in the repo and currently use ServiceLifetime.Transient.
When you target a named endpoint instance, resolve that proxy through IFactory<T> rather than relying on plain interface injection.
HttpClientBuilderHttpClientBuilder exposes:
| Method | Purpose |
|---|---|
ConfigurationHttpClientForApi(Action<HttpClient>) |
default HttpClient configuration for all endpoint proxies |
ConfigurationHttpClientForEndpointApi<T>(Action<HttpClient>) |
HttpClient configuration only for interface T |
Precedence is:
ConfigurationHttpClientForEndpointApi<T>(...)ConfigurationHttpClientForApi(...)AddHttpClient(...) with no extra configurationIRequestEnhancer is the client-side interception hook.
public sealed class CorrelationEnhancer : IRequestEnhancer
{
public ValueTask EnhanceAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
request.Headers.Add("X-Correlation-Id", Guid.NewGuid().ToString());
return ValueTask.CompletedTask;
}
}
Register enhancers with:
| Method | Scope |
|---|---|
AddEnhancerForAllEndpoints<TEnhancer>() |
all generated clients |
AddEnhancerForEndpoint<TEnhancer, T>() |
only the client for interface T |
Enhancer execution order is:
The sample client registers both kinds in src/Api/Test/Rystem.Api.TestClient/Program.cs.
The client proxy uses the endpoint metadata from Rystem.Api to build requests.
cookie headerIAsyncEnumerable<T> results are read as streamed JSONStream, IHttpFile, and IFormFile response shapes are supportedThe route pattern mirrors the server-side metadata:
{BasePath}{EndpointName}/{FactoryName?}{MethodName}
If the client and server do not share the same ConfigureEndpoints(...) and AddEndpoint...(...) definitions, route generation drifts and calls fail.
AddEndpointWithFactory<T>() is expanded automatically on the server during UseEndpointApi(), but the client package does not do the same factory-name fan-out automatically.
If you need named factory-backed clients, use explicit named registrations or AddClientForEndpointApi<T>(..., factoryName) for the specific named endpoint you want.
Query, path, header, and cookie values are composed very directly.
The current implementation does not provide polished URL encoding or rich handling for non-primitive query/header/cookie payloads, so keep those cases simple.
There is no compile-time client code generation here. Debugging behavior is closer to a dynamic proxy than to a handwritten typed HttpClient.
src/Api/Test/Rystem.Api.Test.Domain/ServiceCollectionExtensions.cssrc/Api/Test/Rystem.Api.TestClient/Program.cssrc/Api/Test/Rystem.Api.TestClient/Services/Enhancer.cssrc/Api/Test/Rystem.Api.Test.Domain/IColam.cssrc/Api/Test/Rystem.Api.Test.Domain/IEmbeddingService.csUse this package when you want to call Rystem.Api.Server endpoints through the same interface contracts instead of writing manual HTTP code.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on Rystem.Api.Client:
| Package | Downloads |
|---|---|
|
Rystem.Api.Client.Authentication.BlazorServer
Rystem.Api helps you to integrate Api Server and Automated Client for Aspect-Oriented programming. |
|
|
Rystem.Api.Client.Authentication.BlazorWasm
Rystem.Api helps you to integrate Api Server and Automated Client for Aspect-Oriented programming. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.8 | 5,556 | 5/13/2026 |
| 10.0.7 | 203 | 3/26/2026 |
| 10.0.6 | 433,746 | 3/3/2026 |
| 10.0.5 | 217 | 2/22/2026 |
| 10.0.4 | 222 | 2/9/2026 |
| 10.0.3 | 148,006 | 1/28/2026 |
| 10.0.1 | 209,149 | 11/12/2025 |
| 9.1.3 | 333 | 9/2/2025 |
| 9.1.2 | 764,564 | 5/29/2025 |
| 9.1.1 | 97,861 | 5/2/2025 |
| 9.0.32 | 186,754 | 4/15/2025 |
| 9.0.31 | 5,887 | 4/2/2025 |
| 9.0.30 | 88,900 | 3/26/2025 |
| 9.0.29 | 9,054 | 3/18/2025 |
| 9.0.28 | 287 | 3/17/2025 |
| 9.0.27 | 283 | 3/16/2025 |
| 9.0.26 | 297 | 3/13/2025 |
| 9.0.25 | 52,175 | 3/9/2025 |
| 9.0.21 | 365 | 3/6/2025 |
| 9.0.20 | 19,611 | 3/6/2025 |