ivar v0.10.1 Ivar.Headers
Ivar.Headers manages the request headers used for a request
Summary
Functions
Puts the given headers into the existing request map
Puts the given value under key into the request headers map
Functions
Puts the given headers into the existing request map
Args
request- the map used to store the map of headers, usually created viaIvar.new/2headers- the headers to be put into the headers map
Headers
- Key/value tuple -
{:header, "value"}or{"header", "value"} - List of Key/value tuple -
[{:header, "value"}] - Keyword list -
[header: "value"] - Map -
%{header: "value"}
Usage
iex> Ivar.Headers.put(%{}, [accept: "application/json"])
%{headers: %{"accept" => "application/json"}}
Puts the given value under key into the request headers map
Args
request- the map used to store the map of headers, usually created viaIvar.new/2key- the header name as string or atom (e.g.:headeror"header")value- the header value
Usage
iex> Ivar.Headers.put(%{}, :accept, "application/json")
%{headers: %{"accept" => "application/json"}}