Safe Haskell | None |
---|
- data Group
- group :: [T] -> Group
- ungroup :: Group -> [T]
- setGroup :: HasHeaders x => x -> Group -> x
- getGroup :: HasHeaders x => x -> Group
- list :: HasHeaders x => x -> [T]
- modifyMany :: HasHeaders x => ([T] -> [T]) -> x -> x
- type T = Header
- data Header = Header HeaderName String
- make :: Name -> String -> T
- getName :: T -> Name
- getValue :: T -> String
- name :: T T Name
- value :: T T String
- type Name = HeaderName
- data HeaderName
- = HdrCacheControl
- | HdrConnection
- | HdrDate
- | HdrPragma
- | HdrTransferEncoding
- | HdrUpgrade
- | HdrVia
- | HdrAccept
- | HdrAcceptCharset
- | HdrAcceptEncoding
- | HdrAcceptLanguage
- | HdrAuthorization
- | HdrCookie
- | HdrExpect
- | HdrFrom
- | HdrHost
- | HdrIfModifiedSince
- | HdrIfMatch
- | HdrIfNoneMatch
- | HdrIfRange
- | HdrIfUnmodifiedSince
- | HdrMaxForwards
- | HdrProxyAuthorization
- | HdrRange
- | HdrReferer
- | HdrUserAgent
- | HdrAge
- | HdrLocation
- | HdrProxyAuthenticate
- | HdrPublic
- | HdrRetryAfter
- | HdrServer
- | HdrSetCookie
- | HdrTE
- | HdrTrailer
- | HdrVary
- | HdrWarning
- | HdrWWWAuthenticate
- | HdrAllow
- | HdrContentBase
- | HdrContentEncoding
- | HdrContentLanguage
- | HdrContentLength
- | HdrContentLocation
- | HdrContentMD5
- | HdrContentRange
- | HdrContentType
- | HdrETag
- | HdrExpires
- | HdrLastModified
- | HdrContentTransferEncoding
- | HdrCustom String
- class HasHeaders x
- pGroup :: Parser Group
- makeName :: String -> Name
- insert :: HasHeaders a => Name -> String -> a -> a
- insertIfMissing :: HasHeaders a => Name -> String -> a -> a
- replace :: HasHeaders a => Name -> String -> a -> a
- insertMany :: HasHeaders a => [T] -> a -> a
- lookupMany :: HasHeaders a => Name -> a -> [String]
- lookup :: HasHeaders a => Name -> a -> Maybe String
- makeContentLength :: Integer -> T
- makeContentType :: String -> T
- makeLocation :: URI -> T
- makeLastModified :: ClockTime -> T
- data TransferCoding
- makeTransferCoding :: TransferCoding -> T
- getContentType :: HasHeaders a => a -> Maybe String
- getContentLength :: HasHeaders a => a -> Maybe Integer
Documentation
setGroup :: HasHeaders x => x -> Group -> xSource
getGroup :: HasHeaders x => x -> GroupSource
list :: HasHeaders x => x -> [T]Source
modifyMany :: HasHeaders x => ([T] -> [T]) -> x -> xSource
type Name = HeaderNameSource
data HeaderName
HTTP HeaderName
type, a Haskell data constructor for each
specification-defined header, prefixed with Hdr
and CamelCased,
(i.e., eliding the -
in the process.) Should you require using
a custom header, there's the HdrCustom
constructor which takes
a String
argument.
Encoding HTTP header names differently, as Strings perhaps, is an equally fine choice..no decidedly clear winner, but let's stick with data constructors here.
class HasHeaders x
HasHeaders
is a type class for types containing HTTP headers, allowing
you to write overloaded header manipulation functions
for both Request
and Response
data types, for instance.
HasHeaders Group | |
HasHeaders (Request a) | |
HasHeaders (Response a) | |
HasHeaders (T body) | |
HasHeaders (T body) |
Header parsing
Header manipulation
insert :: HasHeaders a => Name -> String -> a -> aSource
insertIfMissing :: HasHeaders a => Name -> String -> a -> aSource
replace :: HasHeaders a => Name -> String -> a -> aSource
insertMany :: HasHeaders a => [T] -> a -> aSource
lookupMany :: HasHeaders a => Name -> a -> [String]Source
Constructing headers
makeContentLength :: Integer -> TSource
makeContentType :: String -> TSource
makeLocation :: URI -> TSource
makeLastModified :: ClockTime -> TSource
data TransferCoding Source
Getting values of specific headers
getContentType :: HasHeaders a => a -> Maybe StringSource
getContentLength :: HasHeaders a => a -> Maybe IntegerSource