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 String
- Show RequestHeaders- Allow a - RequestHeadersto be represented as a string. This string is formatted in HTTP headers format.
- Eq RequestHeaders- Compare two - RequestHeadersobjects by comparing the underlying- Objects.
- Semigroup RequestHeaders- Allow 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 ResponseHeaders- Allow one - ResponseHeadersobjects to be appended to another.
- Show ResponseHeaders- Allow a - ResponseHeadersto be represented as a string. This string is formatted in HTTP headers format.
- Eq ResponseHeaders- Compare two - ResponseHeadersobjects by comparing the underlying- Objects.
#ToHeaders Source
class ToHeaders r  whereMembers
- headers :: r -> ResponseHeaders- Create - ResponseHeadersfrom a record, an- Array (Tuple String String)or an- Array (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 :: IncomingMessage IMServer -> 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.
#write Source
write :: ServerResponse -> ResponseHeaders -> Effect UnitGiven an HTTP Response and a ResponseHeaders object, return an effect that will
write the ResponseHeaders to the Response.
- Modules
- HTTPurple
- HTTPurple.Body 
- HTTPurple.Cont 
- HTTPurple.Headers 
- HTTPurple.Json 
- HTTPurple.Lookup 
- HTTPurple.Method 
- HTTPurple.Middleware 
- HTTPurple.NodeMiddleware 
- HTTPurple.Path 
- HTTPurple.Query 
- HTTPurple.Request 
- HTTPurple.Response 
- HTTPurple.Routes 
- HTTPurple.Server 
- HTTPurple.Status 
- HTTPurple.Utils 
- HTTPurple.Validation 
- HTTPurple.Version 
Given a string, return a
Maybecontaining the value of the matching header, if there is any.