Polhem.JsonRpc.Payload.Client 1.4.0

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

Polhem.JsonRpc.Payload.Client

The client half of Polhem.JsonRpc.Payload: PayloadConnector seals the parameters of each call into the payload envelope (the codec, gzip for a longer body, the replay-protection frame and the encryption) and opens its result, so an encrypted call is written exactly like a plain one with JsonRpcConnector. It supports trimming and Native AOT, so it runs on iOS, Android and WebAssembly.

var payload = new PayloadProcessor(new PayloadOptions { RequireFrame = true });
var rpc = new PayloadConnector(connector, payload, new PayloadConnectorOptions { KeyProvider = () => sessionKey });

var added = await rpc.InvokeAsync<AddResponse>("Calculator.Add", new AddRequest { A = 1, B = 2 });
var plain = await rpc.InvokeAsync<AddResponse>("Calculator.Add", new AddRequest { A = 3, B = 4 }, PayloadFormat.Plain, CancellationToken.None);

Calls are encrypted unless PayloadConnectorOptions.Format or the call names another format. The connector keeps the KeyProvider function it was created with and calls it on every encrypted call, so a key that changes after a sign-in is used once the function returns it; setting KeyProvider afterwards has no effect. An encrypted call without a key fails, and is never sent in a lower format. With PayloadOptions.RequireFrame on, each encoded or encrypted call takes the next sequence number of the connector, or the number SequenceGenerator returns when the numbers must outlive it. The result is opened into the type the call asks for; InvokeAsync<object> resolves the type the envelope names, which must be registered with PayloadOptions.TypeResolver. InvokeStreamingAsync<TItem, TResult> makes a streamed call: each item is opened as it arrives, and an encrypted one is checked against the request and its place in the stream. A server on 1.3.0 or later answers a method that does not stream with no items. A server on an earlier version seals the result of such a call as the answer to an ordinary call, so an encrypted streamed call to it fails authentication; plain and encoded ones read the result.

Documentation and samples: https://github.com/polhem-dev/polhem-jsonrpc

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 Polhem.JsonRpc.Payload.Client:

Package Downloads
Polhem.Api.Client

Connector for local or remote invocation of backend logic.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.0 0 12/2/2026
1.3.0 94 11/28/2026
1.2.0 2,806 10/5/2026