Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- 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 -> x Source #
getGroup :: HasHeaders x => x -> Group Source #
list :: HasHeaders x => x -> [T] Source #
modifyMany :: HasHeaders x => ([T] -> [T]) -> x -> x Source #
The Header
data type pairs header names & values.
type Name = HeaderName Source #
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.
Instances
Eq HeaderName | |
Defined in Network.HTTP.Headers (==) :: HeaderName -> HeaderName -> Bool # (/=) :: HeaderName -> HeaderName -> Bool # | |
Show HeaderName | |
Defined in Network.HTTP.Headers showsPrec :: Int -> HeaderName -> ShowS # show :: HeaderName -> String # showList :: [HeaderName] -> ShowS # |
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.
Instances
HasHeaders Group Source # | |
Defined in Network.MoHWS.HTTP.Header getHeaders :: Group -> [Header] # setHeaders :: Group -> [Header] -> Group # | |
HasHeaders (Request a) | |
Defined in Network.HTTP.Base getHeaders :: Request a -> [Header] # setHeaders :: Request a -> [Header] -> Request a # | |
HasHeaders (Response a) | |
Defined in Network.HTTP.Base getHeaders :: Response a -> [Header] # setHeaders :: Response a -> [Header] -> Response a # | |
HasHeaders (T body) Source # | |
Defined in Network.MoHWS.HTTP.Request getHeaders :: T body -> [Header] # setHeaders :: T body -> [Header] -> T body # | |
HasHeaders (T body) Source # | |
Defined in Network.MoHWS.HTTP.Response getHeaders :: T body -> [Header] # setHeaders :: T body -> [Header] -> T body # |
Header parsing
Header manipulation
insertIfMissing :: HasHeaders a => Name -> String -> a -> a Source #
insertMany :: HasHeaders a => [T] -> a -> a Source #
lookupMany :: HasHeaders a => Name -> a -> [String] Source #
Constructing headers
makeContentLength :: Integer -> T Source #
makeContentType :: String -> T Source #
makeLocation :: URI -> T Source #
makeLastModified :: ClockTime -> T Source #
data TransferCoding Source #
Instances
Eq TransferCoding Source # | |
Defined in Network.MoHWS.HTTP.Header (==) :: TransferCoding -> TransferCoding -> Bool # (/=) :: TransferCoding -> TransferCoding -> Bool # |
makeTransferCoding :: TransferCoding -> T Source #
Getting values of specific headers
getContentType :: HasHeaders a => a -> Maybe String Source #
getContentLength :: HasHeaders a => a -> Maybe Integer Source #