xclient v0.6.0-vendored-xhttp XClient.Headers View Source
Functions for working with HTTP request and response headers, as described in the HTTP 1.1 specification.
Headers are represented in Elixir as a list of {"header_name", "value"}
tuples. Multiple entries for the same header name are allowed.
Capitalization of header names is preserved during insertion
(put_header/3
), however header names are handled case-insensitively
during lookup (get_header/2
, get_header_values/2
) and deletion
(delete_header/2
).
Link to this section Summary
Functions
Removes all instances of the given header
Returns the value for the given HTTP request or response header,
or nil
if not found
Returns all values for the given HTTP request or response header. Returns an empty list if none found
Returns an ordered list of the header names from the given headers. Header names are returned in lowercase
Returns a copy of the given headers where all header names are lowercased
and multiple values for the same header have been joined with ","
Puts the given header value
under name
, removing any values previously
stored under name
. The new header is placed at the end of the list
Link to this section Types
Link to this section Functions
Removes all instances of the given header.
Header names are matched case-insensitively.
Returns the value for the given HTTP request or response header,
or nil
if not found.
Header names are matched case-insensitively.
If more than one matching header is found, the values are joined with
","
as specified in RFC 2616.
Returns all values for the given HTTP request or response header. Returns an empty list if none found.
Header names are matched case-insensitively.
Returns an ordered list of the header names from the given headers. Header names are returned in lowercase.
Returns a copy of the given headers where all header names are lowercased
and multiple values for the same header have been joined with ","
.
Puts the given header value
under name
, removing any values previously
stored under name
. The new header is placed at the end of the list.
Header names are matched case-insensitively, but case of name
is preserved
when adding the header.