wai-extra-3.0.26.1: Provides some basic WAI handlers and middleware.

Safe Haskell | None
Language | Haskell2010

Network.Wai.Handler.CGI

Description

Backend for Common Gateway Interface. Almost all users should use the `run` function.

Synopsis

- run :: Application -> IO ()
- runSendfile :: ByteString -> Application -> IO ()
- runGeneric :: [(String, String)] -> (Int -> IO (IO ByteString)) -> (ByteString -> IO ()) -> Maybe ByteString -> Application -> IO ()
- requestBodyFunc :: (Int -> IO (Maybe ByteString)) -> Int -> IO (IO ByteString)

# Documentation

run :: Application -> IO () Source #

Run an application using CGI.

runSendfile Source #

Arguments

:: ByteString | sendfile header
-> Application |
-> IO () |

Some web servers provide an optimization for sending files via a sendfile system call via a special header. To use this feature, provide that header name here.

runGeneric Source #

Arguments

:: [(String, String)] | all variables
-> (Int -> IO (IO ByteString)) | responseBody of input
-> (ByteString -> IO ()) | destination for output
-> Maybe ByteString | does the server support the X-Sendfile header?
-> Application |
-> IO () |

A generic CGI helper, which allows other backends (FastCGI and SCGI) to use the same code as CGI. Most users will not need this function, and can stick with `run` or `runSendfile`.

requestBodyFunc :: (Int -> IO (Maybe ByteString)) -> Int -> IO (IO ByteString) Source #