Safe Haskell | None |
---|
Snap.Predicate.Header
- data Header a = Header {
- _hdrName :: !ByteString
- _hdrRead :: [ByteString] -> Either ByteString a
- _hdrDefault :: !(Maybe a)
- data Hdr a = Hdr ByteString
- data HdrOpt a = HdrOpt ByteString
- data HdrDef a = HdrDef ByteString a
- data HasHdr = HasHdr ByteString
Documentation
The most generic request header predicate provided.
It will get all request header values of _name
and pass them on to
the conversion function _read
, which might either yield an error
message or a value. If the header is not present, an optional default may be
returned instead, if nothing is provided, the error message will be used
when construction the 400 status.
Constructors
Header | |
Fields
|
Specialisation of Header
which returns the first request
header value which could be converted to the target type.
Relies on Readable
type-class for the actual conversion.
Constructors
Hdr ByteString |
Predicate which returns the first request header which could be
converted to the target type wrapped in a Maybe.
If the header is not present, Nothing
will be returned.
Relies on Readable
type-class for the actual conversion.
Constructors
HdrOpt ByteString |
Specialisation of Header
which returns the first request
header value which could be converted to the target type.
If the header is not present, the provided default will be used.
Relies on Readable
type-class for the actual conversion.
Constructors
HdrDef ByteString a |