-- 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.1.0 module Network.SCGI data SCGI a -- | Run a request in the SCGI monad. runRequest :: Handle -> (Body -> SCGI Response) -> IO () -- | Lookup a request header. header :: ByteString -> SCGI (Maybe ByteString) -- | Return all request headers as a list in the format they were received -- from the web server. allHeaders :: SCGI [(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 :: SCGI (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 :: SCGI (Maybe ByteString) -- | Set a response header. setHeader :: ByteString -> ByteString -> SCGI () type Headers = Map (CI ByteString) ByteString type Body = ByteString type Status = ByteString data Response Response :: Status -> Body -> Response instance Functor SCGI instance Monad SCGI instance MonadIO SCGI instance MonadState Headers SCGI instance MonadReader Headers SCGI