ReqClient.Adapter.Req (req_client v0.1.17)

Copy Markdown View Source

Req (req builtin) adapter, default in req_client

eg. R.g :x, debug: true

Connecting through a proxy with basic authentication:

iex> Req.new(
...>  url: "https://elixir-lang.org",
...>  connect_options: [
...>    proxy: {:http, "your.proxy.com", 8888, []},
...>    proxy_headers: [{"proxy-authorization", "Basic " <> Base.encode64("user:pass")}]
...>  ]
...> )
iex> |> Req.get!()

Transport errors are represented as Req.TransportError exceptions:

iex> Req.get("https://httpbin.org/delay/1", receive_timeout: 0, retry: false)
{:error, %Req.TransportError{reason: :timeout}}

Summary

Functions

kind_name()

maybe_proxy_req(req)