Copyright | Allele Dev 2015 |
---|---|
License | BSD-3 |
Maintainer | allele.dev@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- data Env = Env {}
- type EnvMap k v = Map k v
- type ParamMap a = EnvMap Text (Maybe Text)
- data QueryParams
- data FormParams
- defaultEnv :: Env
- mkHeaders :: RequestHeaders -> Headers
- mkQParams :: Query -> QParams
- mkFParams :: ByteString -> Maybe [(Text, Maybe Text)]
- toEnv :: Request -> Env
- toEnvWithForm :: Request -> [(Text, Text)] -> Env
- toEnvRaw :: Request -> ByteString -> Env
Documentation
data QueryParams Source #
data FormParams Source #
defaultEnv :: Env Source #
mkHeaders :: RequestHeaders -> Headers Source #
mkFParams :: ByteString -> Maybe [(Text, Maybe Text)] Source #
Given a ByteString, constructs association list
toEnv :: Request -> Env Source #
Construct an Env without parsing any form parameters This is ideal if you're not consuming any form data.
toEnvWithForm :: Request -> [(Text, Text)] -> Env Source #
Construct an Env from a Request and an association list of form parameters
If a framework exposes parameters in this fashion (Spock, Scotty),
use this over toEnvRaw
. It's likely the framework consumes the
request body when data is sent along using content-type
'application/x-www-form-urlencoded'