-- 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. It's still rough but currently powers -- www.vocabulink.com and jekor.com. @package sscgi @version 0.3.0 module Network.SCGI data SCGIT m a type SCGI = SCGIT IO -- | Run a request in the SCGI monad. runRequest :: MonadCatchIO m => Handle -> SCGIT m Response -> m () -- | Look up 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)] -- | Return the request body. body :: Monad m => SCGIT m (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 () -- | Look up a response header (one set during this request). This is -- useful when you need to check if a header has been set already (in -- case you want to modify it, for example). responseHeader :: Monad m => ByteString -> SCGIT m (Maybe ByteString) type Headers = Map (CI ByteString) ByteString type Body = ByteString type Status = ByteString data Response Response :: Status -> Body -> Response negotiate :: Monad m => [ByteString] -> SCGIT m [ByteString] instance Monad m => Monad (SCGIT m) instance Monad m => MonadState Headers (SCGIT m) instance Monad m => MonadReader (Headers, Body) (SCGIT m) instance MonadIO m => MonadIO (SCGIT m) instance MonadCatchIO m => MonadCatchIO (SCGIT m) instance MonadTrans SCGIT