An interceptor for Tesla.Adapter.Gun, Tesla's adapter for gun.
Implementation notes:
- The response's body is returned as the
:body_asoption tells: as a binary with:plain, the default, or as a stream of one chunk with:stream.:chunksisn't supported for requests that fakes handle, and raises.:max_bodyapplies like in the adapter. - Like in the adapter, an empty response body is
"", also with:stream. - A request body from a stream, a function or a
Tesla.Multipartreaches the fakes whole. Loopback.HTTPErrorreasons are returned the way the adapter returns them::timeoutand:closedas:recv_response_timeout, and the other reasons, like:econnrefused, as:timeout, since gun keeps retrying to connect until the adapter stops waiting.- The options that control the connection, like
:connand:timeout, apply only to requests passed through.