- data CIByteString = CIByteString {}
- mkCIByteString :: ByteString -> CIByteString
- type Method = ByteString
- methodGet :: Method
- methodPost :: Method
- methodHead :: Method
- methodPut :: Method
- methodDelete :: Method
- methodTrace :: Method
- methodConnect :: Method
- methodOptions :: Method
- data StdMethod
- parseMethod :: Method -> Either ByteString StdMethod
- renderMethod :: Either ByteString StdMethod -> Method
- renderStdMethod :: StdMethod -> Method
- data HttpVersion = HttpVersion {}
- http09 :: HttpVersion
- http10 :: HttpVersion
- http11 :: HttpVersion
- data Status = Status {}
- status200 :: Status
- statusOK :: Status
- status201 :: Status
- statusCreated :: Status
- status301 :: Status
- statusMovedPermanently :: Status
- status302 :: Status
- statusFound :: Status
- status303 :: Status
- statusSeeOther :: Status
- status400 :: Status
- statusBadRequest :: Status
- status401 :: Status
- statusUnauthorized :: Status
- status403 :: Status
- statusForbidden :: Status
- status404 :: Status
- statusNotFound :: Status
- status405 :: Status
- statusNotAllowed :: Status
- status500 :: Status
- statusServerError :: Status
- type Header = (CIByteString, ByteString)
- type RequestHeaders = [Header]
- type ResponseHeaders = [Header]
- headerAccept :: ByteString -> Header
- headerCacheControl :: ByteString -> Header
- headerConnection :: ByteString -> Header
- headerContentLength :: ByteString -> Header
- headerContentType :: ByteString -> Header
- headerContentMD5 :: ByteString -> Header
- headerDate :: ByteString -> Header
- type QueryItem = (ByteString, Maybe ByteString)
- type Query = [QueryItem]
- type SimpleQueryItem = (ByteString, ByteString)
- type SimpleQuery = [SimpleQueryItem]
- renderQuery :: Bool -> Query -> ByteString
- renderSimpleQuery :: Bool -> SimpleQuery -> ByteString
- parseQuery :: ByteString -> Query
- parseSimpleQuery :: ByteString -> SimpleQuery
- urlEncode :: ByteString -> ByteString
- urlDecode :: ByteString -> ByteString
Case insensitive HTTP ByteStrings
data CIByteString Source
Case-insensitive HTTP ByteStrings, mostly for use in Header names.
mkCIByteString :: ByteString -> CIByteStringSource
Make a case-insensitive ByteString from a normal ByteString.
Methods
type Method = ByteStringSource
HTTP method (flat string type).
HTTP Method constants.
HTTP standard method (as defined by RFC 2616).
parseMethod :: Method -> Either ByteString StdMethodSource
Convert a method ByteString
to a StdMethod
if possible.
renderMethod :: Either ByteString StdMethod -> MethodSource
Convert an algebraic method to a ByteString
.
renderStdMethod :: StdMethod -> MethodSource
Convert a StdMethod
to a ByteString
.
Versions
data HttpVersion Source
HTTP Version.
Note that the Show instance is intended merely for debugging.
HTTP 0.9
HTTP 1.0
HTTP 1.1
Status
HTTP Status.
Only the statusCode
is used for comparisons.
Note that the Show instance is only for debugging.
Created
statusMovedPermanently :: StatusSource
Moved Permanently
Found
statusSeeOther :: StatusSource
See Other
statusBadRequest :: StatusSource
Bad Request
statusUnauthorized :: StatusSource
Unauthorized
statusForbidden :: StatusSource
Forbidden
statusNotFound :: StatusSource
Not Found
statusNotAllowed :: StatusSource
Method Not Allowed
statusServerError :: StatusSource
Internal Server Error
Headers
type Header = (CIByteString, ByteString)Source
Header
type RequestHeaders = [Header]Source
Request Headers
type ResponseHeaders = [Header]Source
Response Headers
headerCacheControl :: ByteString -> HeaderSource
HTTP Headers
headerDate :: ByteString -> HeaderSource
Query string
type QueryItem = (ByteString, Maybe ByteString)Source
Query item
type Query = [QueryItem]Source
Query.
General form: a=b&c=d, but if the value is Nothing, it becomes a&c=d.
type SimpleQueryItem = (ByteString, ByteString)Source
Simplified Query item type without support for parameter-less items.
type SimpleQuery = [SimpleQueryItem]Source
Simplified Query type without support for parameter-less items.
renderQuery :: Bool -> Query -> ByteStringSource
Convert Query
to ByteString
.
renderSimpleQuery :: Bool -> SimpleQuery -> ByteStringSource
Convert SimpleQuery
to ByteString
.
parseQuery :: ByteString -> QuerySource
Parse Query
from a ByteString
.
parseSimpleQuery :: ByteString -> SimpleQuerySource
Parse SimpleQuery
from a ByteString
.
URL encoding / decoding
urlEncode :: ByteString -> ByteStringSource
Percent-encoding for URLs.
urlDecode :: ByteString -> ByteStringSource
Percent-decoding.