HTTPill v0.2.0 HTTPill.HeaderList View Source

A HTTPill.HeaderList is intented to represent the list of headers for HTTP requests and responses.

It can be represented in the form of a map or a key-value list (similar to keyword lists, but with strings as keys), but you it’s recomended to use a key-value list, since it’s allowed to have multiple value for a same key.

Link to this section Summary

Functions

Gets the given header on the list

Normalizes the list to the prefered way, a key-value list

Puts the given value for the key on the list

Link to this section Types

Link to this type t() View Source
t() :: [{binary, binary}] | %{optional(binary) => binary}

Link to this section Functions

Link to this function get(list, header, default_value \\ nil) View Source
get(t, binary, term) :: term

Gets the given header on the list.

Returns default_value if no header found.

Link to this function normalize(list) View Source
normalize(t) :: t

Normalizes the list to the prefered way, a key-value list.

Link to this function put(list, key, value) View Source
put(t, binary, binary) :: t

Puts the given value for the key on the list.