# `ExWapp.Media.HTTP`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/media/http.ex#L1)

Minimal WhatsApp media upload/download client.

The session worker supplies IQ access through `opts[:session]`; this module
queries `media_conn`, uploads encrypted media bodies, and downloads encrypted
bodies that are later verified and decrypted by `ExWapp.Media.Crypto`.

# `download`

```elixir
@spec download(map(), ExWapp.Media.Ref.t(), keyword()) ::
  {:ok, binary()} | {:error, term()}
```

Downloads encrypted media and returns the decrypted plaintext bytes.

# `upload`

```elixir
@spec upload(map(), ExWapp.Media.media_type(), binary(), keyword()) ::
  {:ok, ExWapp.Media.Upload.t()} | {:error, term()}
```

Encrypts plaintext media and uploads it to the best available media host.

---

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