class

JsonRpc::HttpClient

Inherits JsonRpc::Client / Reference / Object

Implements JSON-RPC over HTTP transport. Uses POST requests and doesn't support notifications to be received.

Authentication

To do authentication, configure the HTTP::Client you pass in as needed.

An example for HTTP Basic auth:

http_client = HTTP::Client.new("some.internal.server", 1234)
http_client.basic_auth("my-username", "the-password")

rpc_client = JsonRpc::HttpClient.new(http_client)
# rpc_client will now use basic authentication for each request!

Constructors

new(http_client : HTTP::Client, endpoint : String = "/")
Source

Instance methods

endpoint
Source
endpoint=(endpoint : String)
Source
http_client
Source
inspect(io)
Source
recv_message(id)

Dummy implementation, this client doesn't use a persistant connection, and will never receive a remotely-initiated packet.

Source
remote_address

Returns the remote address for display/logging purposes

Source
send_message(id, message_data)
Source