sendRequest method
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, int? id]) =>
_client.sendRequest(method, parameters, id);