JSONRPC2.Client (jsonrpc2_client v2.0.2)

Copy Markdown

Documentation for JSONRPC2.Client.

Example:

alias JSONRPC2.Spec.Result
alias JSONRPC2.Spec.Error

[%Result{}, %Error{}] =
  method
  |> JSONRPC2.Client.call(params, id)
  |> JSONRPC2.Client.call(method, params, id)
  |> JSONRPC2.Client.notify(method, params)
  |> JSONRPC2.Client.send(
    "http://127.0.0.1:4000",
    headers: [%{"X-Token" => token()}],
    recv_timeout: 3000,
    timeout: 3000
  )

Summary

Functions

adapter()

call(method, params, id)

See JSONRPC2.Spec.Batch.call/3.

call(batch, method, params, id)

See JSONRPC2.Spec.Batch.call/4.

notify(method, params)

See JSONRPC2.Spec.Batch.notify/2.

notify(batch, method, params)

See JSONRPC2.Spec.Batch.notify/3.

send(batch, url, opts \\ [])