# `Macaw.Live.Proxy.Fetcher.Httpc.Transport`
[🔗](https://github.com/dcoai/macaw_live/blob/v0.1.0/lib/macaw/live/proxy/fetcher/httpc/transport.ex#L1)

What `Macaw.Live.Proxy.Fetcher.Httpc` performs its I/O through (spec/06 §1.6), a behavior
over an argument: `:httpc`'s asynchronous request and its cancel. The fetcher builds
everything else (the peer verification its `ssl` options give, no redirect, the headers,
the byte cap and the timeout), so a test hands it a transport of its own that records
what it was given and answers as `:httpc` would, and no socket opens.
`Macaw.Live.Proxy.Fetcher.Httpc.Transport.Inets`, OTP's `:httpc`, is the default.

`request(arg, request, http_options, options)` is one `GET`, `request` being `:httpc`'s
`{url, headers}` in charlists and the options `:httpc.request/4`'s, `stream: :self`
among them. It answers `{:ok, ref}` and the answer comes to the caller as `:httpc`'s
messages, `{:http, {ref, ...}}`, or `{:error, reason}`. `cancel(arg, ref)` stops a
request; what it had sent already may still be in the caller's mailbox.

# `cancel`

```elixir
@callback cancel(arg :: term(), ref :: reference()) :: :ok
```

# `request`

```elixir
@callback request(
  arg :: term(),
  request :: {charlist(), [{charlist(), charlist()}]},
  http_options :: keyword(),
  options :: keyword()
) :: {:ok, reference()} | {:error, term()}
```

---

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