# `Loopback.Interceptors.Httpc`
[🔗](https://github.com/stefanchrobot/loopback/blob/v0.1.0/lib/loopback/interceptors/httpc.ex#L1)

An interceptor for `:httpc`, the HTTP client of Erlang/OTP, and the clients built on it,
like Tesla's default adapter, `Tesla.Adapter.Httpc`.

Implementation notes:

  * Synchronous and asynchronous requests are intercepted, including the `:receiver`
    option.
  * The `:stream` option works like in `:httpc`, for 200 and 206 responses. Streaming to the
    calling process sends the body in one `stream` message. With `{:self, :once}`, the
    stream is sent without waiting for `:httpc.stream_next/1`, like `:httpc` sends a body
    that has already arrived.
  * A fake's response gets an HTTP/1.1 status line, with the standard reason phrase of its
    status.
  * Like in `:httpc`, a request's content type replaces its `content-type` header.
  * `Loopback.HTTPError` reasons are returned the way `:httpc` returns them: `:timeout` as
    `:timeout`, `:closed` as `:socket_closed_remotely`, and the other reasons as
    `{:failed_connect, [...]}`.
  * Asynchronous requests that fakes handle get request IDs of their own, which work with
    `:httpc.cancel_request/1,2`.
  * Requests that fakes handle ignore the HTTP options, like `:timeout`, and the profile,
    and don't need `:inets` to be started.

# `cancel_request`

# `cancel_request`

# `request`

# `request`

# `request`

# `request`

---

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