wai-request-spec-0.10.2.4: Declarative request parsing

CopyrightAllele Dev 2015
LicenseBSD-3
Maintainerallele.dev@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Network.Wai.RequestSpec.Internal.Env

Description

 

Synopsis

Documentation

data Env Source #

Constructors

Env 

type EnvMap k v = Map k v 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'

toEnvRaw :: Request -> ByteString -> Env Source #

Expects form data via request body ByteString This is appropriate if you're programming with raw Network.Wai NOTE: if you're expecting form data, and the form data is in an invalid format this will happily construct an Env with empty form data