ReqClient (req_client v0.1.16)

Copy Markdown View Source

Request client based on Req & Finch & Mint!

No client-level process, all use Req, just a simple wrapper!

Examples

iex> ReqClient.get!("https://slink.fly.dev/api/ping") iex> ReqClient.get!("https://api.github.com/repos/elixir-lang/elixir")

Summary

Functions

protocols: [:http1]]

Delete request

Delete request with direct response

Get request

Get request with direct response

Get cache dir if unspecified in options with :cache_dir key

Get req-client supported option list now

Head request

Head request with direct response

Build a new Req client request with custom plugins

Patch request

Patch request with direct response

Post request

Post request with direct response

Run request

Run request with direct response

Functions

default_finch_opts()

protocols: [:http1]]

Req.Finch default pool not support proxy!!!

default_opts()

More options from https://hexdocs.pm/req/Req.html#new/1-options

default_req_opts()

delete(url, opts \\ [])

Delete request

Examples

iex> ReqClient.delete "https://httpbin.org/delete"

delete!(url, opts \\ [])

Delete request with direct response

Examples

iex> ReqClient.delete! "https://httpbin.org/delete"

finch_children(sup \\ Req.FinchSupervisor)

finch_pool_opts(request)

find_option(req, options \\ [])

get(url, opts \\ [])

Get request

Examples

iex> ReqClient.get "https://httpbin.org/get"

get!(url, opts \\ [])

Get request with direct response

Examples

iex> ReqClient.get! "https://httpbin.org/get"

get_cache_dir(request \\ new())

Get cache dir if unspecified in options with :cache_dir key

iex> url = "https://elixir-lang.org" iex> Req.get!(url, cache: true)

$> ls -al ~/Library/Caches/req

get_kind(req)

get_option_list(r \\ new([]))

Get req-client supported option list now

get_private(req_or_resp)

has_option?(req, option)

head(url, opts \\ [])

Head request

Examples

iex> ReqClient.head "https://httpbin.org/head"

head!(url, opts \\ [])

Head request with direct response

Examples

iex> ReqClient.head! "https://httpbin.org/head"

list_options(r \\ new())

new(opts \\ [])

Build a new Req client request with custom plugins

patch(url, opts \\ [])

Patch request

Examples

iex> ReqClient.patch "https://httpbin.org/patch"

patch!(url, opts \\ [])

Patch request with direct response

Examples

iex> ReqClient.patch! "https://httpbin.org/patch"

post(url, opts \\ [])

Post request

Examples

iex> ReqClient.post "https://httpbin.org/post"

post!(url, opts \\ [])

Post request with direct response

Examples

iex> ReqClient.post! "https://httpbin.org/post"

run(url, opts \\ [])

Run request

Examples

iex> ReqClient.run "https://httpbin.org/run"

run!(url, opts \\ [])

Run request with direct response

Examples

iex> ReqClient.run! "https://httpbin.org/run"

verbose?(req)