# `Req.Adapter`
[🔗](https://github.com/wojtekmach/req/blob/v0.8.0-rc.0/lib/req/adapter.ex#L1)

The adapter contract.

By default Req uses `Finch` (via `Req.Finch`) and supports arbitrary adapters implementing this
behaviour.

Req adapters are closely related to step wrappers, see
["Steps & Step Wrappers" section](`Req.Request#module-steps-step-wrappers`) in `Req.Request` module documentation for
more information.

# `stream`

```elixir
@callback stream(req, acc, fun, state) ::
  {:ok, resp, acc, state}
  | {:halt, resp, acc, state}
  | {{:error, err}, resp, acc, state}
when req: Req.Request.t(),
     resp: Req.Response.t(),
     err: Exception.t(),
     acc: term(),
     fun: (event, resp, acc, state -&gt;
             {:ok, resp, acc, state}
             | {:halt, resp, acc, state}
             | {{:error, err}, resp, acc, state}),
     state: term(),
     event:
       {:status, non_neg_integer()}
       | {:headers, [{binary(), binary()}]}
       | {:data, binary()}
       | {:trailers, [{binary(), binary()}]}
```

---

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