|
Network.CGI.Protocol | Portability | non-portable | Stability | experimental | Maintainer | bjorn@bringert.net |
|
|
|
|
|
Description |
An implementation of the program side of the CGI protocol.
|
|
Synopsis |
|
data CGIRequest = CGIRequest {} | | data Input = Input {} | | | | type Headers = [(HeaderName, String)] | | newtype HeaderName = HeaderName String | | hRunCGI :: MonadIO m => [(String, String)] -> Handle -> Handle -> (CGIRequest -> m (Headers, CGIResult)) -> m () | | runCGIEnvFPS :: Monad m => [(String, String)] -> ByteString -> (CGIRequest -> m (Headers, CGIResult)) -> m ByteString | | decodeInput :: [(String, String)] -> ByteString -> ([(String, Input)], ByteString) | | takeInput :: [(String, String)] -> ByteString -> ByteString | | getCGIVars :: MonadIO m => m [(String, String)] | | logCGI :: MonadIO m => String -> m () | | formEncode :: [(String, String)] -> String | | urlEncode :: String -> String | | formDecode :: String -> [(String, String)] | | urlDecode :: String -> String | | maybeRead :: Read a => String -> Maybe a | | replace :: Eq a => a -> a -> [a] -> [a] |
|
|
|
CGI request
|
|
|
The input to a CGI action.
| Constructors | | Instances | |
|
|
|
The value of an input parameter, and some metadata.
| Constructors | | Instances | |
|
|
CGI response
|
|
|
The result of a CGI program.
| Constructors | | Instances | |
|
|
|
|
|
A string with case insensitive equality and comparisons.
| Constructors | | Instances | |
|
|
Running CGI actions
|
|
|
|
|
|
|
|
Inputs
|
|
|
:: [(String, String)] | CGI environment variables.
| -> ByteString | Request body.
| -> ([(String, Input)], ByteString) | A list of input variables and values, and the request body
if it was not interpreted.
| Gets and decodes the input according to the request
method and the content-type.
|
|
|
|
:: [(String, String)] | CGI environment variables.
| -> ByteString | Request body.
| -> ByteString | CONTENT_LENGTH bytes from the request
body, or the empty string if there is no
CONTENT_LENGTH.
| Takes the right number of bytes from the input.
|
|
|
Environment variables
|
|
|
Gets the values of all CGI variables from the program environment.
|
|
Logging
|
|
|
Logs some message using the server's logging facility.
FIXME: does this have to be more general to support
FastCGI etc? Maybe we should store log messages in the
CGIState?
|
|
URL encoding
|
|
|
Formats name-value pairs as application/x-www-form-urlencoded.
|
|
|
Converts a single value to the application/x-www-form-urlencoded encoding.
|
|
|
Gets the name-value pairs from application/x-www-form-urlencoded data.
|
|
|
Converts a single value from the
application/x-www-form-urlencoded encoding.
|
|
Utilities
|
|
|
|
|
:: Eq a | | => a | Value to look for
| -> a | Value to replace it with
| -> [a] | Input list
| -> [a] | Output list
| Replaces all instances of a value in a list by another value.
|
|
|
Produced by Haddock version 0.8 |