struct JsonRpc::Request

Overview

Encapsulates a JSON-RPC request object

Included Modules

Defined in:

json_rpc/request.cr

Constructors

Instance Method Summary

Instance methods inherited from module JsonRpc::MessageHeader

id : IdType | Nil id, jsonrpc : String | Nil jsonrpc

Constructor Detail

def self.new(id : Int64 | String | Nil, method : String, params) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

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

Creates an error response.


[View source]
def method : String #

[View source]
def params : JSON::Any | Nil #

[View source]
def raw_params : String | Nil #

[View source]
def respond(failure : LocalCallError) #

Creates an error response.


[View source]
def respond(result) #

Creates a successful response based on result.


[View source]
def 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.


[View source]