Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Request
An HTTP Request.
Eq Request Source | |
Show Request Source | |
Param Request Source | It traverses the values with the same key both in the query string
and the form encoded body of a |
Formed Request Source | |
HasBody Request Source | |
HasQuery Request Source | |
HasPath Request Source | |
HasHost Request Source | |
HasUrl Request Source | |
Server (Request -> Maybe Response) Source | |
Server (Request -> Response) Source |
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"]
GET
A GET
Request
.
POST
A POST
Request
.
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.