-- 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.5 module Network.HTTP.Types -- | HTTP method (flat string type). type Method = Ascii 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). 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 Ascii StdMethod -- | Convert an algebraic method to a ByteString. renderMethod :: Either Ascii 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 -> Ascii -> Status statusCode :: Status -> Int statusMessage :: Status -> Ascii 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 = (CIAscii, Ascii) -- | Request Headers type RequestHeaders = [Header] -- | Response Headers type ResponseHeaders = [Header] headerAccept :: Ascii -> Header -- | HTTP Headers headerCacheControl :: Ascii -> Header headerConnection :: Ascii -> Header headerContentLength :: Ascii -> Header headerContentType :: Ascii -> Header headerContentMD5 :: Ascii -> Header headerDate :: Ascii -> 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 SimpleQuery to Query. simpleQueryToQuery :: SimpleQuery -> Query -- | Convert Query to ByteString. renderQuery :: Bool -> Query -> Ascii renderQueryBuilder :: Bool -> Query -> AsciiBuilder -- | Convert SimpleQuery to ByteString. renderSimpleQuery :: Bool -> SimpleQuery -> Ascii -- | Split out the query string into a list of keys and values. A few -- importants points: -- -- parseQuery :: ByteString -> Query -- | Parse SimpleQuery from a ByteString. parseSimpleQuery :: ByteString -> SimpleQuery -- | Encodes a list of path segments into a valid URL fragment. -- -- This function takes the following three steps: -- -- -- -- For example: -- --
--   encodePathInfo [\"foo\", \"bar\", \"baz\"]
--   
-- -- "foo/bar/baz" -- --
--   encodePathInfo [\"foo bar\", \"baz\/bin\"]
--   
-- -- "foo%20bar/baz%2Fbin" -- --
--   encodePathInfo [\"\"]
--   
-- -- "%D7%A9%D7%9C%D7%95%D7%9D" -- -- Huge thanks to Jeremy Shaw who created the original implementation of -- this function in web-routes and did such thorough research to -- determine all correct escaping procedures. encodePathSegments :: [Text] -> AsciiBuilder decodePathSegments :: ByteString -> [Text] encodePath :: [Text] -> Query -> AsciiBuilder decodePath :: ByteString -> ([Text], Query) urlEncodeBuilder :: Bool -> ByteString -> AsciiBuilder urlEncode :: Bool -> ByteString -> Ascii -- | Percent-decoding. urlDecode :: Bool -> ByteString -> ByteString instance Read StdMethod instance Show StdMethod instance Eq StdMethod instance Ord StdMethod instance Enum StdMethod instance Bounded StdMethod instance Ix StdMethod instance Eq HttpVersion instance Ord HttpVersion instance Show Status instance Ord Status instance Eq Status instance Show HttpVersion