# `WardrikHTTP.Response`

Sends an operation's output, or the protocol's `error` with its HTTP status.

# `answer`

```elixir
@spec answer(
  Plug.Conn.t(),
  WardrikProtocol.operation(),
  {:ok, term()} | {:error, Wardrik.Error.t()}
) ::
  Plug.Conn.t()
```

Sends `operation`'s output with its success status, or the error.

# `error`

```elixir
@spec error(Plug.Conn.t(), Wardrik.Error.t()) :: Plug.Conn.t()
```

Sends `error` with the HTTP status for its type, as `404` for `:not_found`.

# `json`

```elixir
@spec json(Plug.Conn.t(), pos_integer(), term()) :: Plug.Conn.t()
```

Sends `body` as JSON.

# `relay`

```elixir
@spec relay(Plug.Conn.t(), {:ok, map()} | {:error, Wardrik.Error.t()}) ::
  Plug.Conn.t()
```

Sends a channel's response unchanged, or the error.

---

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