Module

HTTPure.Headers

#Headers

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.

Constructors

Instances

  • 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

empty :: Headers

Return a Headers containing nothing.

#headers

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

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

#header

header :: String -> String -> Headers

Create a singleton header from a key-value pair.

#read

read :: Request -> Headers

Get the headers out of a HTTP Request object.

#write

write :: Response -> Headers -> Effect Unit

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

Modules