HTTP client for unary SkirRPC methods.
Summary
Functions
Invokes a method and returns {:ok, response} or {:error, %Skir.RPC.RpcError{}}. Options include :headers, :http_method (:post or :get), and transport options.
Invokes a method, returning the decoded response or raising Skir.RPC.RpcError.
Creates an HTTP client, returning {:ok, client} or {:error, message}. Accepts :headers, :transport, and :transport_opts.
Creates an HTTP client or raises ArgumentError for an invalid URL or options.
Returns a client with the default header replaced case-insensitively, or added if absent.
Types
Functions
@spec invoke(t(), Skir.Method.t(), term(), keyword()) :: {:ok, term()} | {:error, Skir.RPC.RpcError.t()}
Invokes a method and returns {:ok, response} or {:error, %Skir.RPC.RpcError{}}. Options include :headers, :http_method (:post or :get), and transport options.
@spec invoke!(t(), Skir.Method.t(), term(), keyword()) :: term()
Invokes a method, returning the decoded response or raising Skir.RPC.RpcError.
Creates an HTTP client, returning {:ok, client} or {:error, message}. Accepts :headers, :transport, and :transport_opts.
Creates an HTTP client or raises ArgumentError for an invalid URL or options.
Returns a client with the default header replaced case-insensitively, or added if absent.