-- 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.1 module Network.HTTP.Types -- | Case-insensitive HTTP ByteStrings, mostly for use in Header names. data HttpCIByteString HttpCIByteString :: !ByteString -> !ByteString -> HttpCIByteString ciOriginal :: HttpCIByteString -> !ByteString ciLowerCase :: HttpCIByteString -> !ByteString mkHttpCIByteString :: ByteString -> HttpCIByteString -- | 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 method (ADT version). -- -- 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 MethodADT GET :: MethodADT POST :: MethodADT HEAD :: MethodADT PUT :: MethodADT DELETE :: MethodADT TRACE :: MethodADT CONNECT :: MethodADT OPTIONS :: MethodADT -- | Convert a method ByteString to a MethodADT. methodToADT :: Method -> MethodADT -- | Convert a MethodADT to a ByteString. methodFromADT :: MethodADT -> Method -- | Convert a method String to a MethodADT. stringToMethodADT :: String -> MethodADT -- | Convert a MethodADT to a String. methodADTToString :: MethodADT -> String -- | HTTP Version. -- -- Note that the Show instance is intended merely for debugging. data HttpVersion -- | 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 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 -- | Request Header type RequestHeaders = [(HttpCIByteString, ByteString)] -- | Response Headers type ResponseHeaders = [(HttpCIByteString, ByteString)] -- | Query. -- -- General form: a=b&c=d, but if the value is Nothing, it becomes -- a&c=d. type Query = [(ByteString, Maybe ByteString)] -- | Simplified Query type without support for parameter-less items. type QuerySimple = [(ByteString, ByteString)] instance Show Status instance Eq HttpVersion instance Ord HttpVersion instance Show MethodADT instance Eq MethodADT instance Ord MethodADT instance Ord Status instance Eq Status instance Show HttpVersion instance IsString HttpCIByteString instance Show HttpCIByteString instance Ord HttpCIByteString instance Eq HttpCIByteString