Raptor RPC Client
A transport-agnostic RPC client that follows the JSON-RPC 2.0 spec. Works in the browser and on the server.
npm install --save raptor-client
var raptor =var client =client
var raptor =var client =clientclient
Returns a new
Client connected to the specific uri.
Supported protocols in the browser:
Supported protocols on Node.js:
The server has sent a notification to us.
Client#send(method[, params]) => Promise<any>
Send a request to the server. Returns a promise of the result from the server.
If an error response is returned from the sever, the promise will reject with an
error that has
.rpcData populated from the response.
Client#notify(method[, params]) => Promise<void>
Send a notification to the server. Returns a promise that will resolve when the notification has been sent to server.
The promise will only reject if there is a network problem, since a server cannot respond to a notification.