gossamer/headers
Types
This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.
pub type Headers
Values
pub fn append(
headers: Headers,
name: String,
value: String,
) -> Headers
Appends a new value onto an existing header inside a Headers object, or
adds the header if it does not already exist.
pub fn from_pairs(pairs: List(#(String, String))) -> Headers
pub fn get(
headers: Headers,
name: String,
) -> option.Option(String)
Returns a ByteString sequence of all the values of a header within a
Headers object with a given name.
pub fn get_set_cookie(headers: Headers) -> List(String)
Returns an array containing the values of all Set-Cookie headers
associated with a response.
pub fn has(headers: Headers, name: String) -> Bool
Returns a boolean stating whether a Headers object contains a certain
header.