JSONRPC2 v0.3.0 JSONRPC2.Clients.HTTP

A client for JSON-RPC 2.0 using an HTTP transport with JSON in the body.

Summary

Types

Functions

batch(url, requests, headers \\ [], http_method \\ :post, hackney_opts \\ [])

Specs

batch(String.t, [JSONRPC2.Request.request], any, atom, list) ::
  [batch_result] |
  :ok |
  {:error, any}

Make a batch request via url for JSON-RPC 2.0 requests.

You can also pass headers, http_method, and hackney_opts to customize the options for hackney.

See hackney for more information on the available options.

call(url, method, params, headers \\ [], http_method \\ :post, hackney_opts \\ [])

Specs

call(String.t, JSONRPC2.method, JSONRPC2.params, any, atom, list) ::
  {:ok, any} |
  {:error, any}

Make a call to url for JSON-RPC 2.0 method with params.

You can also pass headers, http_method, and hackney_opts to customize the options for hackney.

See hackney for more information on the available options.

notify(url, method, params, headers \\ [], http_method \\ :post, hackney_opts \\ [])

Specs

notify(String.t, JSONRPC2.method, JSONRPC2.params, any, atom, list) ::
  :ok |
  {:error, any}

Notify via url for JSON-RPC 2.0 method with params.

You can also pass headers, http_method, and hackney_opts to customize the options for hackney.

See hackney for more information on the available options.