struct

JsonRpc::Request

Inherits JsonRpc::MessageHeader / JSON::Serializable / Struct / Value / Object

Encapsulates a JSON-RPC request object

Constructors

new(id : Int64 | String | Nil, method : String, params)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

error(code : Int32, message : String, data : JSON::Any | Nil = nil)

Creates an error response.

Source
method
Source
params
Source
raw_params
Source
respond(failure : LocalCallError)

Creates an error response.

Source
respond(result)

Creates a successful response based on result.

Source
respond_later(client : Client) : DelayedResponse

Returns a DelayedResponse, bound to client.

Return the result of this method from your Handler#handle_rpc_call, and keep a handle to it somewhere to respond later.

Source