nuts-json-rpc
这是一个遵循 json-rpc2.0 协议的 node 客户端
安装方法:
$ npm install --save-dev nuts-json-rpc
使用:
const createClient NutsJsonRPC = ; async { try thishost = `/rpc/`; const client = ; let value = await client; console; catch err console; }; // orasync { try thishost = `/rpc/`; const client = `` port 'Authorization': 'uid'; let value = await client; console; catch err console; };
API:
call(method, params)
发起一个正常的rpc请求
notify(method, params)
发起一个rpc通知
printRequestBody(function)
打印请求体
const client = `` 80;client;