#Headers Source

newtype Headers

The Headers type is just sugar for a Object of Strings that represents the set of headers in an HTTP request or response.



  • Newtype Headers _
  • Lookup Headers String String

    Given a string, return a Maybe containing the value of the matching header, if there is any.

  • Show Headers

    Allow a Headers to be represented as a string. This string is formatted in HTTP headers format.

  • Eq Headers

    Compare two Headers objects by comparing the underlying Objects.

  • Semigroup Headers

    Allow one Headers objects to be appended to another.

#empty Source

empty :: Headers

Return a Headers containing nothing.

#headers Source

headers :: Array (Tuple String String) -> Headers

Convert an Array of Tuples of 2 Strings to a Headers object.

#header Source

header :: String -> String -> Headers

Create a singleton header from a key-value pair.

#read Source

read :: Request -> Headers

Get the headers out of a HTTP Request object.

#write Source

write :: Response -> Headers -> Effect Unit

Given an HTTP Response and a Headers object, return an effect that will write the Headers to the Response.