Ankh.HTTP.Request (ankh v0.14.4)

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

Specs

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

Request method

Specs

options() :: keyword()

HTTP request options

Specs

path() :: String.t()

Request path

Specs

query() :: Enum.t()

Request query

Specs

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

Link to this function

fetch_header_values(request, header)

Specs

fetch_header_values(t(), Ankh.HTTP.header_name()) :: [Ankh.HTTP.header_value()]

See Ankh.HTTP.fetch_header_values/2.

Link to this function

fetch_trailer_values(request, trailer)

Specs

fetch_trailer_values(t(), Ankh.HTTP.header_name()) :: [Ankh.HTTP.header_value()]

See Ankh.HTTP.fetch_trailer_values/2.

Specs

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

new(attrs \\ [])

Specs

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

put_header(request, name, value)

Specs

put_header(t(), Ankh.HTTP.header_name(), Ankh.HTTP.header_value()) :: t()

See Ankh.HTTP.put_header/3.

Link to this function

put_headers(request, headers)

Specs

put_headers(t(), Ankh.HTTP.headers()) :: t()

See Ankh.HTTP.put_headers/2.

Link to this function

put_options(request, new_options)

Specs

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

put_path(request, path)

Specs

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

put_query(request, query)

Specs

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

put_trailer(request, name, value)

Specs

put_trailer(t(), Ankh.HTTP.header_name(), Ankh.HTTP.header_value()) :: t()

See Ankh.HTTP.put_trailer/3.

Link to this function

put_trailers(request, trailers)

Specs

put_trailers(t(), Ankh.HTTP.headers()) :: t()

See Ankh.HTTP.put_trailers/2.

Link to this function

put_uri(request, uri)

Specs

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

set_body(request, body)

Specs

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

set_method(request, method)

Specs

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

set_path(request, path)

Specs

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

set_query(request, query)

Specs

set_query(t(), query()) :: t()

Specs

to_uri(t()) :: URI.t()
Link to this function

validate_body(request)

Specs

validate_body(t()) :: {:ok, t()} | :error

See Ankh.HTTP.validate_body/1.

Link to this function

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

Specs

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