-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple SCGI Library -- -- This is a simple implementation of the SCGI protocol without support -- for the Network.CGI interface. @package sscgi @version 0.2.0 module Network.SCGI data SCGIT m a type SCGI = SCGIT IO -- | Run a request in the SCGI monad. runRequest :: MonadIO m => Handle -> (Body -> SCGIT m Response) -> m () -- | Lookup a request header. header :: Monad m => ByteString -> SCGIT m (Maybe ByteString) -- | Return all request headers as a list in the format they were received -- from the web server. allHeaders :: Monad m => SCGIT m [(ByteString, ByteString)] -- | Get the request method (GET, POST, etc.). You could look the header up -- yourself, but this normalizes the method name to uppercase. method :: Monad m => SCGIT m (Maybe ByteString) -- | Get the requested path. According to the spec, this can be complex, -- and actual CGI implementations diverge from the spec. I've found this -- to work, even though it doesn't seem correct or intuitive. path :: Monad m => SCGIT m (Maybe ByteString) -- | Set a response header. setHeader :: Monad m => ByteString -> ByteString -> SCGIT m () type Headers = Map (CI ByteString) ByteString type Body = ByteString type Status = ByteString data Response Response :: Status -> Body -> Response instance Monad m => Monad (SCGIT m) instance Monad m => MonadState Headers (SCGIT m) instance Monad m => MonadReader Headers (SCGIT m) instance MonadIO m => MonadIO (SCGIT m) instance MonadTrans SCGIT