Ankh.HTTP.Response (ankh v0.14.4)

Ankh HTTP Response

Link to this section Summary

Types

Response status

t()

Link to this section Types

Specs

status() :: pos_integer()

Response status

Specs

t() :: %Ankh.HTTP.Response{
  body: Ankh.HTTP.body(),
  body_fetched: boolean(),
  complete: boolean(),
  headers: Ankh.HTTP.headers(),
  status: status(),
  trailers: Ankh.HTTP.headers()
}

Link to this section Functions

Link to this function

fetch_body(response)

Specs

fetch_body(t()) :: t()
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.

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_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

set_body(response, body)

Specs

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

set_status(response, status)

Specs

set_status(t(), status()) :: t()
Link to this function

validate_body(response)

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}