HTTP.Request (http_fetch v0.5.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() | HTTP.FormData.t() | nil

content_type()

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

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: HTTP.Headers.t(),
  http_options: httpc_options(),
  method: method(),
  options: httpc_client_opts(),
  url: url()
}

url()

@type url() :: URI.t()

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.