HTTP.Request (http_fetch v0.1.0)

Represents an HTTP request that can be serialized into :httpc.request arguments.

Summary

Functions

Converts an HTTP.Request struct into arguments suitable for :httpc.request/4.

Types

body_content()

@type body_content() :: String.t() | charlist() | nil

content_type()

@type content_type() :: String.t() | charlist() | nil

headers()

@type headers() :: [{String.t() | charlist(), String.t() | charlist()}]

httpc_client_opts()

@type httpc_client_opts() :: Keyword.t()

httpc_options()

@type httpc_options() :: Keyword.t()

method()

@type method() :: :head | :get | :post | :put | :delete | :patch

t()

@type t() :: %HTTP.Request{
  body: body_content(),
  content_type: content_type(),
  headers: headers(),
  method: method(),
  options: httpc_options(),
  opts: httpc_client_opts(),
  url: url()
}

url()

@type url() :: String.t() | charlist()

Functions

to_httpc_args(req)

@spec to_httpc_args(t()) :: {atom(), tuple(), Keyword.t(), Keyword.t()}

Converts an HTTP.Request struct into arguments suitable for :httpc.request/4.