Safe Haskell | None |
---|
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
- data Headers
- empty :: Headers
- null :: Headers -> Bool
- member :: CI ByteString -> Headers -> Bool
- lookup :: CI ByteString -> Headers -> Maybe [ByteString]
- lookupWithDefault :: ByteString -> CI ByteString -> Headers -> [ByteString]
- insert :: CI ByteString -> ByteString -> Headers -> Headers
- set :: CI ByteString -> ByteString -> Headers -> Headers
- delete :: CI ByteString -> Headers -> Headers
- fold :: (a -> CI ByteString -> [ByteString] -> a) -> a -> Headers -> a
- toList :: Headers -> [(CI ByteString, ByteString)]
- fromList :: [(CI ByteString, ByteString)] -> Headers
Headers type
Headers creation
Predicates
Lookup
lookup :: CI ByteString -> Headers -> Maybe [ByteString]Source
lookupWithDefault :: ByteString -> CI ByteString -> Headers -> [ByteString]Source
Adding/setting headers
insert :: CI ByteString -> ByteString -> Headers -> HeadersSource
set :: CI ByteString -> ByteString -> Headers -> HeadersSource
Deleting
Traversal
fold :: (a -> CI ByteString -> [ByteString] -> a) -> a -> Headers -> aSource
Lists
toList :: Headers -> [(CI ByteString, ByteString)]Source
fromList :: [(CI ByteString, ByteString)] -> HeadersSource