ReqClient.Channel.Mint (req_client v0.1.17)

Copy Markdown View Source

Simple http(1/2) client only depends-on mint package in passive mode like finch package!

  • mainly used in script

Example

eg. M.get :x

Todo

  • support request_timeout as total like finch
  • http2 not work with proxy??? If both :http1 and :http2 are present in the list passed in the :protocols option, the protocol negotiation happens in the following way:
  • json coding

Options

Summary

Functions

delete(url, opts \\ [])

delete request

delete!(url, opts \\ [])

format_response(resp, ref)

get(url, opts \\ [])

get request

get!(url, opts \\ [])

get_conn(url, opts \\ [])

get_connect_opts(opts \\ [])

get_content_wise_resp_body?(opts \\ [])

get_protocol(conn)

get_proxy_tuple()

get_recv_timeout(n)

get_req_headers(headers \\ %{})

get_req_path(map)

head(url, opts \\ [])

head request

head!(url, opts \\ [])

maybe_proxy_opts(uri, opts \\ [])

no_proxy?(map, no_proxy_list \\ [])

normalize_method(method \\ "GET")

post(url, opts \\ [])

post request

post!(url, opts \\ [])

recv(conn, byte_count, timeout, acc \\ [], debug?, times \\ 0)

recv_done?(responses)

req(uri, opts \\ [])

Base request method

Options

  • debug
  • method
  • headers %{"header_name1" => ["value1"]}
  • body in string
  • timing

  • other channel-specific options

About response

  • is map todo typespec
  • body: should be binary
  • headers: %{"header_name1" => ["value1"]}
    • header name should in lowercase string
    • value in a list

simple_responses(resp)