HTTPurple.Headers
- Package
- purescript-httpurple
- Repository
- sigma-andex/purescript-httpurple
#RequestHeaders Source
newtype RequestHeadersThe RequestHeaders type is a wrapper for a map
that represents the set of headers in an HTTP request.
A request header contains maximum one value per key.
Constructors
Instances
Newtype RequestHeaders _Lookup RequestHeaders String StringShow RequestHeadersAllow a
RequestHeadersto be represented as a string. This string is formatted in HTTP headers format.Eq RequestHeadersCompare two
RequestHeadersobjects by comparing the underlyingObjects.Semigroup RequestHeadersAllow one
RequestHeadersobjects to be appended to another.
#ResponseHeaders Source
newtype ResponseHeadersThe ResponseHeaders type is a wrapper for a map
that represents the set of headers in an HTTP response.
A response header can contain multiple values per key,
e.g. in the case of multiple Set-Cookie directives.
Constructors
Instances
Semigroup ResponseHeadersAllow one
ResponseHeadersobjects to be appended to another.Show ResponseHeadersAllow a
ResponseHeadersto be represented as a string. This string is formatted in HTTP headers format.Eq ResponseHeadersCompare two
ResponseHeadersobjects by comparing the underlyingObjects.
#ToHeaders Source
class ToHeaders r whereMembers
headers :: r -> ResponseHeadersCreate
ResponseHeadersfrom a record, anArray (Tuple String String)or anArray (Tuple String (Array String))
Instances
#ToHeadersHelper Source
class ToHeadersHelper :: forall k. Row Type -> k -> Constraintclass ToHeadersHelper r rl where
Members
headersImpl :: Proxy rl -> Record r -> ResponseHeaders
Instances
ToHeadersHelper r Nil(IsSymbol sym, RowToList r rl, RowToList tail tailRL, Cons sym String tail r, Lacks sym tail, ToHeadersHelper tail tailRL) => ToHeadersHelper r (Cons sym String tailRL)(IsSymbol sym, RowToList r rl, RowToList tail tailRL, Cons sym (Array String) tail r, Lacks sym tail, ToHeadersHelper tail tailRL) => ToHeadersHelper r (Cons sym (Array String) tailRL)
#empty Source
empty :: ResponseHeadersReturn a ResponseHeaders containing no headers.
#header Source
header :: String -> String -> ResponseHeadersCreate a singleton header from a key-value pair.
#mkRequestHeader Source
mkRequestHeader :: String -> String -> RequestHeadersCreate a singleton header from a key-value pair. This is intended mainly for internal use.
#mkRequestHeaders Source
mkRequestHeaders :: Array (Tuple String String) -> RequestHeadersConvert an Array of Tuples of 2 Strings to a RequestHeaders object.
This is intended mainly for internal use.
#read Source
read :: Request -> RequestHeadersGet the headers out of a HTTP RequestHeaders object.
#toResponseHeaders Source
toResponseHeaders :: RequestHeaders -> ResponseHeadersCopy the request headers to the response headers This is intended mainly for internal use.
Given a string, return a
Maybecontaining the value of the matching header, if there is any.