# `Latch.XRPC`

DPoP-authenticated XRPC calls to a session's PDS.

Each request carriers `Authorization: DPoP <token` and a DPoP proof bound to
the acess token `ath`. The PDS issues its own DPoP nonces, so a request is
attempted once and retried with the nonce the PDS returns. Token refresh and
persistence are the caller's concerns, not this module's.

# `error`

```elixir
@type error() ::
  Latch.Error.InvalidResponse.t()
  | Latch.Error.MissingDPoPNonce.t()
  | Latch.Error.Transport.t()
  | Latch.Error.XRPC.t()
```

# `procedure`

```elixir
@spec procedure(Latch.Config.t(), Latch.Session.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, error()}
```

Performs and authenticated XRPC procedure against the session's PDS.

# `query`

```elixir
@spec query(Latch.Config.t(), Latch.Session.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, error()}
```

Performs and authenticated XRPC query against the session's PDS.

# `upload_blob`

```elixir
@spec upload_blob(
  Latch.Config.t(),
  Latch.Session.t(),
  binary(),
  String.t(),
  keyword()
) ::
  {:ok, map()} | {:error, error()}
```

Uploads raw bytes of content_type as a blob, returning the response with
the blog reference.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
