{
  "id": 14195165,
  "title": "A JSON-RPC Library With No Method Registration: How Does It Decide What Can Be Called?",
  "url": "https://urgent.news/2026/10/13/a-json-rpc-library-with-no-method-registration-how-does-it-decide",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-13T12:09:53.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/jeff377/a-json-rpc-library-with-no-method-registration-how-does-it-decide-what-can-be-called-2dcn"
  },
  "original_language": "en",
  "account": "JSON-RPC 2.0 is a simple specification that requires the client to send a request containing the method name and parameters, while the server responds with the result or an error. This straightforward approach works well when both the client and server are controlled by the same team. Polhem.JsonRpc is a .NET library that implements JSON-RPC 2.0, providing transport-independent server functionality, an ASP.NET Core endpoint, and a client library, all built on System.Text.Json. The library was originally part of the Polhem framework but has been extracted into standalone packages that can be used independently of the framework. These packages are available on GitHub under the MIT license and on NuGet.\n\nThe library supports various aspects of JSON-RPC 2.0, including ordinary calls, notifications, and batches. It allows for string, integer, or null identifiers, and the method dispatcher does not rely on HTTP. The ASP.NET Core endpoint package handles the mapping of JSON-RPC calls, while the client library supports HTTP transports, batches, notifications, and interceptors for parameter and result manipulation. Optional features include payload encryption, compression, and replay protection.\n\nTo get started with the library, an ASP.NET Core server can be created using Minimal APIs. The server uses the MapJsonRpc method to create a POST endpoint, which handles JSON-RPC calls. The configuration options for the server include settings for batching, filters, and HTTP response codes. The object factory is responsible for creating objects based on the requested method, and in the presented example, it maps the \"Calculator\" identifier to a Calculator class. The client library is straightforward to use, requiring only the creation of an HttpClient and a JsonRpcConnector instance connected to the server. To call a method, such as Calculator.Add, the client invokes the corresponding method using the InvokeAsync method. The beauty of this approach is that it does not require any method registration, allowing any public method of the calculator class to be called without prior configuration.",
  "summary": "JSON-RPC 2.0 is a small specification: the client sends {\"jsonrpc\":\"2.0\",\"method\":\"...\",\"params\":{...},\"id\":1} , and the server answers with a result or an error . REST makes you decide on routes, HTTP verbs and status codes; JSON-RPC only cares about which method to call and with what parameters. For an API where you own both the front end and the back end, that is pleasant to work with.…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}