Module

HTTPure.MultiHeaders

Package
purescript-httpure
Repository
citizennet/purescript-httpure

#MultiHeaders Source

newtype MultiHeaders

The MultiHeaders type represets the set of headers in a HTTP request or response read in a way such that every header name maps to a non-empty list of header values. This is useful for headers that may have multiple values, such as "Set-Cookie".

Constructors

Instances

#empty Source

empty :: MultiHeaders

Return a MultiHeaders containing nothing.

#fromHeaders Source

fromHeaders :: Headers -> MultiHeaders

Create a MultiHeaders out of a Headers value.

#header Source

header :: String -> String -> MultiHeaders

Create a singleton header from a key-value pair.

#header' Source

header' :: String -> NonEmptyArray String -> MultiHeaders

Create a singleton header from a key-values pair.

#headers Source

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

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

#headers' Source

headers' :: Array (Tuple String (NonEmptyArray String)) -> MultiHeaders

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

#read Source

read :: Request -> MultiHeaders

Read the headers out of a HTTP Request object and parse duplicated headers as a list (instead of comma-separated values, as with HTTPure.Headers.read).

#toString Source

toString :: MultiHeaders -> String

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

#write Source

write :: Response -> MultiHeaders -> Effect Unit

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