Exosphere.XRPC.Client (Exosphere v0.3.0)

Copy Markdown View Source

Public-facing XRPC client built on top of Exosphere.ATProto.XRPC.Client.

Summary

Functions

Create a new XRPC client.

Make an XRPC procedure (HTTP POST).

Make an XRPC query (HTTP GET).

Upload a blob to the PDS.

Set the access token on a client.

Types

Functions

new(base_url, opts \\ [])

@spec new(
  String.t(),
  keyword()
) :: t()

Create a new XRPC client.

See Exosphere.ATProto.XRPC.Client.new/2 for options.

procedure(client, nsid, body \\ %{})

@spec procedure(t(), String.t(), map() | keyword()) ::
  {:ok, Exosphere.ATProto.HTTP.json_term()}
  | {:error, Exosphere.ATProto.XRPC.Client.error()}

Make an XRPC procedure (HTTP POST).

query(client, nsid, params \\ [])

@spec query(t(), String.t(), keyword() | map()) ::
  {:ok, Exosphere.ATProto.HTTP.json_term()}
  | {:error, Exosphere.ATProto.XRPC.Client.error()}

Make an XRPC query (HTTP GET).

upload_blob(client, data, content_type)

@spec upload_blob(t(), binary(), String.t()) ::
  {:ok, map()} | {:error, Exosphere.ATProto.XRPC.Client.error()}

Upload a blob to the PDS.

with_token(client, token)

@spec with_token(t(), String.t()) :: t()

Set the access token on a client.