sendRequest method

  1. @override
Future sendRequest (
  1. String method,
  2. [dynamic parameters]
)
override

Sends a JSON-RPC 2 request to invoke the given method.

If passed, parameters is the parameters for the method. This must be either an Iterable (to pass parameters by position) or a Map with String keys (to pass parameters by name). Either way, it must be JSON-serializable.

If the request succeeds, this returns the response result as a decoded JSON-serializable object. If it fails, it throws an RpcException describing the failure.

Throws a StateError if the client is closed while the request is in flight, or if the client is closed when this method is called.

Implementation

@override
Future sendRequest(String method, [parameters]) =>
    _client.sendRequest(method, parameters);