-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generic HTTP types for Haskell (for both client and server code). -- -- Generic HTTP types for Haskell (for both client and server code). @package http-types @version 0.3.0 module Network.HTTP.Types -- | Case-insensitive HTTP ByteStrings, mostly for use in Header names. data CIByteString CIByteString :: !ByteString -> !ByteString -> CIByteString ciOriginal :: CIByteString -> !ByteString ciLowerCase :: CIByteString -> !ByteString mkCIByteString :: ByteString -> CIByteString -- | HTTP method (flat string type). type Method = ByteString methodGet :: Method -- | HTTP Method constants. methodPost :: Method methodHead :: Method methodPut :: Method methodDelete :: Method methodTrace :: Method methodConnect :: Method methodOptions :: Method -- | HTTP standard method (as defined by RFC 2616). -- -- Note that the Show instance is only for debugging and should NOT be -- used to generate HTTP method strings; use methodToByteString -- instead. -- -- The constructor OtherMethod is not exported for forwards -- compatibility reasons. data StdMethod GET :: StdMethod POST :: StdMethod HEAD :: StdMethod PUT :: StdMethod DELETE :: StdMethod TRACE :: StdMethod CONNECT :: StdMethod OPTIONS :: StdMethod -- | Convert a method ByteString to a StdMethod if -- possible. parseMethod :: Method -> Either ByteString StdMethod -- | Convert an algebraic method to a ByteString. renderMethod :: Either ByteString StdMethod -> Method -- | Convert a StdMethod to a ByteString. renderStdMethod :: StdMethod -> Method -- | HTTP Version. -- -- Note that the Show instance is intended merely for debugging. data HttpVersion HttpVersion :: !Int -> !Int -> HttpVersion httpMajor :: HttpVersion -> !Int httpMinor :: HttpVersion -> !Int -- | HTTP 0.9 http09 :: HttpVersion -- | HTTP 1.0 http10 :: HttpVersion -- | HTTP 1.1 http11 :: HttpVersion -- | HTTP Status. -- -- Only the statusCode is used for comparisons. -- -- Note that the Show instance is only for debugging. data Status Status :: Int -> ByteString -> Status statusCode :: Status -> Int statusMessage :: Status -> ByteString status200 :: Status -- | OK statusOK :: Status status201 :: Status -- | Created statusCreated :: Status status301 :: Status -- | Moved Permanently statusMovedPermanently :: Status status302 :: Status -- | Found statusFound :: Status status303 :: Status -- | See Other statusSeeOther :: Status status400 :: Status -- | Bad Request statusBadRequest :: Status status401 :: Status -- | Unauthorized statusUnauthorized :: Status status403 :: Status -- | Forbidden statusForbidden :: Status status404 :: Status -- | Not Found statusNotFound :: Status status405 :: Status -- | Method Not Allowed statusNotAllowed :: Status status500 :: Status -- | Internal Server Error statusServerError :: Status -- | Header type Header = (CIByteString, ByteString) -- | Request Headers type RequestHeaders = [Header] -- | Response Headers type ResponseHeaders = [Header] headerAccept :: ByteString -> Header -- | HTTP Headers headerCacheControl :: ByteString -> Header headerConnection :: ByteString -> Header headerContentLength :: ByteString -> Header headerContentType :: ByteString -> Header headerContentMD5 :: ByteString -> Header headerDate :: ByteString -> Header -- | Query item type QueryItem = (ByteString, Maybe ByteString) -- | Query. -- -- General form: a=b&c=d, but if the value is Nothing, it becomes -- a&c=d. type Query = [QueryItem] -- | Simplified Query item type without support for parameter-less items. type SimpleQueryItem = (ByteString, ByteString) -- | Simplified Query type without support for parameter-less items. type SimpleQuery = [SimpleQueryItem] -- | Convert Query to ByteString. renderQuery :: Bool -> Query -> ByteString -- | Convert SimpleQuery to ByteString. renderSimpleQuery :: Bool -> SimpleQuery -> ByteString -- | Parse Query from a ByteString. parseQuery :: ByteString -> Query -- | Parse SimpleQuery from a ByteString. parseSimpleQuery :: ByteString -> SimpleQuery -- | Percent-encoding for URLs. urlEncode :: ByteString -> ByteString -- | Percent-decoding. urlDecode :: ByteString -> ByteString instance Show Status instance Eq HttpVersion instance Ord HttpVersion instance Read StdMethod instance Show StdMethod instance Eq StdMethod instance Ord StdMethod instance Enum StdMethod instance Bounded StdMethod instance Ix StdMethod instance Ord Status instance Eq Status instance Show HttpVersion instance IsString CIByteString instance Show CIByteString instance Ord CIByteString instance Eq CIByteString