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
Newtype MultiHeaders _
Generic MultiHeaders _
Lookup MultiHeaders String (NonEmptyArray String)
Show MultiHeaders
Eq MultiHeaders
Compare two
MultiHeaders
objects by comparing the underlyingObjects
.Semigroup MultiHeaders
Allow one
MultiHeaders
objects to be appended to another.Monoid MultiHeaders
#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 (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.
Given a string, return a
Maybe
containing the values of the matching header, if there is any.