Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- data Request
- method :: Request -> ByteString
- _GET :: Prism' Request Request
- _POST :: Prism' Request Request
- params :: Traversal' Request MultiMap
- dummyRequest :: Request
- dummyRequestForm :: Request
Documentation
An HTTP Request.
method :: Request -> ByteString Source
Show Request
method.
params :: Traversal' Request MultiMap Source
This Traversal
lets you traverse every HTTP parameter regardless of
whether it's present in the query string or in the form encoded body
of a POST
Request
. In the rare case where there are HTTP parameters in
both, every parameter is still being traversed starting from the /query
string/.
You might want to use param
for traversing a specific parameter.
>>>
let request = dummyRequestForm & query . at "name" ?~ ["hello", "out"] & form . at "name" ?~ ["there"]
>>>
foldOf params request ^? ix "name"
Just ["hello","out","there"]
Testing
dummyRequest :: Request Source
An empty GET request useful for testing.
dummyRequestForm :: Request Source
An empty POST request with an empty form encoded body useful for testing.