|
|
|
| Description |
This module contains functions to access HTTP GET and POST variables.
HTTP vars can be accessed in three ways.
I. If you need to get/set only several variables, you can use httpGetVar and its family. That requires HttpRequest as argument.
II. If you need this in controller, it's simpler to use _GET and its family. That is used as argument for asks.
III. If you need to get/set many HTTP variables, it's better to fetch a variables map (with getvars or postvars), and work with it (with getString or getFile).
|
|
| Synopsis |
|
|
|
| Documentation |
|
| _GET :: String -> ActionConfig -> String |
Get value of GET variable. Sample usage in controller:
controller = do
var <- asks (_GET "varname")
|
|
| _GET' |
| :: String | Var name
| | -> String | Default value
| | -> ActionConfig | | | -> String | | | Same as _GET, but with default value
|
|
|
| _POST :: String -> ActionConfig -> String |
| Get value of POST variable (see notes for _GET)
|
|
| _POST' |
| :: String | Var name
| | -> String | Default value
| | -> ActionConfig | | | -> String | | | Same as _POST, but with default value
|
|
|
| getvars :: HttpRequest -> HttpVarsMap |
| Get map of GET variables from request
|
|
| postvars :: HttpRequest -> HttpVarsMap |
| Get map of POST variables from request
|
|
| getVar |
|
|
| getVar' |
| :: HttpVarsMap | | | -> String | Variable name
| | -> String | Default value
| | -> HttpVar | | | Get a variable from map, with default value
|
|
|
| getFile |
|
|
| getString |
| :: HttpVarsMap | | | -> String | Variable name
| | -> Maybe String | | | Get a string variable from map
|
|
|
| getString' |
| :: HttpVarsMap | | | -> String | Variable name
| | -> String | Default value
| | -> String | | | Same, but with default value
|
|
|
| httpGetVar' |
| :: HttpRequest | | | -> String | Variable name
| | -> String | Default value
| | -> String | | | Get string GET variable directly from request, with default value
|
|
|
| httpPostVar :: HttpRequest -> String -> Maybe String |
| Get string POST variable directly from request
|
|
| httpPostVar' |
| :: HttpRequest | | | -> String | Variable name
| | -> String | Default value
| | -> String | | | Same, but with default value
|
|
|
| httpAddGetVar |
| :: HttpRequest | | | -> String | Var name
| | -> String | Var value
| | -> String | | | Add GET var to given Request and return resulting URL
|
|
|
| urlAddGetVar |
| :: String | URL
| | -> String | Var name
| | -> String | Var value
| | -> String | New URL
| | Add GET variable to given URL
|
|
|
| Produced by Haddock version 2.4.2 |