ut-port-jsonrpc

7.3.3 • Public • Published

UT Port JSON RPC

Provides standard JSON-RPC over HTTP implementation, this ports inherits and extends ut-port-http

This port allows easy calling of remote procedures exposed on remote HTTP server.

If the port works in namespace a, calling

bus.importMethod('a.b.c')({a: 'foo', b: 'bar'})

will send standard json-rpc request to the remote server:

{
  "id": "1",
  "jsonrpc": "2.0",
  "method": "a.b.c",
  "params": {"a": 'foo', "b": "bar"}
}

If HTTP returns response like:

{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
      "c": "baz"
  }
}

Response from the bus.importMethod()() will be:

{
    "c": "baz"
}

Readme

Keywords

none

Package Sidebar

Install

npm i ut-port-jsonrpc

Weekly Downloads

11

Version

7.3.3

License

Apache-2.0

Unpacked Size

132 kB

Total Files

34

Last publish

Collaborators

  • kalin.krustev