snap-core-0.9.5.0: Snap: A Haskell Web Framework (core interfaces and types)

Safe HaskellNone

Snap.Types.Headers

Contents

Description

An opaque data type for HTTP headers. Intended to be imported qualified, i.e:

 import           Snap.Types.Headers (Headers)
 import qualified Snap.Types.Headers as H

 foo :: Headers
 foo = H.empty

Synopsis

Headers type

data Headers

Instances

Headers creation

Predicates

null :: Headers -> Bool

member :: CI ByteString -> Headers -> Bool

Lookup

lookup :: CI ByteString -> Headers -> Maybe [ByteString]

lookupWithDefault :: ByteString -> CI ByteString -> Headers -> [ByteString]

Adding/setting headers

insert :: CI ByteString -> ByteString -> Headers -> Headers

set :: CI ByteString -> ByteString -> Headers -> Headers

Deleting

delete :: CI ByteString -> Headers -> Headers

Traversal

fold :: (a -> CI ByteString -> [ByteString] -> a) -> a -> Headers -> a

Lists

toList :: Headers -> [(CI ByteString, ByteString)]

fromList :: [(CI ByteString, ByteString)] -> Headers