Ankh.HTTP.Request (ankh v0.17.0)

Ankh HTTP Request

Link to this section Summary

Types

Request method

HTTP request options

Request path

Request query

t()

HTTP Request

Link to this section Types

@type method() ::
  :CONNECT | :DELETE | :GET | :HEAD | :OPTIONS | :PATCH | :POST | :PUT | :TRACE

Request method

@type options() :: keyword()

HTTP request options

@type path() :: String.t()

Request path

@type query() :: Enum.t()

Request query

@type t() :: %Ankh.HTTP.Request{
  body: Ankh.HTTP.body(),
  headers: Ankh.HTTP.headers(),
  method: method(),
  options: options(),
  path: path(),
  trailers: Ankh.HTTP.headers()
}

HTTP Request

Link to this section Functions

@spec from_uri(URI.t()) :: t()
Link to this function

new(attrs \\ [])

@spec new(Enum.t()) :: t()
Link to this function

put_options(request, new_options)

@spec put_options(t(), options()) :: t()
Link to this function

put_path(request, path)

@spec put_path(t(), path()) :: t()
Link to this function

put_query(request, query)

@spec put_query(t(), query()) :: t()
Link to this function

put_uri(request, uri)

@spec put_uri(t(), URI.t()) :: t()
Link to this function

set_body(request, body)

@spec set_body(t(), iodata()) :: t()
Link to this function

set_method(request, method)

@spec set_method(t(), method()) :: t()
Link to this function

set_path(request, path)

@spec set_path(t(), path()) :: t()
Link to this function

set_query(request, query)

@spec set_query(t(), query()) :: t()
@spec to_uri(t()) :: URI.t()
Link to this function

validate_headers(headers, strict, forbidden \\ [])

@spec validate_headers(Ankh.HTTP.headers(), boolean(), [Ankh.HTTP.header_name()]) ::
  :ok | {:error, :protocol_error}