yesodweb / yesod

A RESTful Haskell web framework built on WAI.
http://www.yesodweb.com/
MIT License
2.64k stars 374 forks source link

[yesod-test] Add full support for query string #1822

Open yitz-zoomin opened 1 year ago

yitz-zoomin commented 1 year ago

Requests in yesod-test only support GET parameters in the format key=value. Bare GET parameters are not supported, and more importantly (for us), you cannot access GET API endpoints that require JSON in the query string.

The wai library supports these use cases by allowing you to supply Nothing for the value of the GET parameter. But yesod-test blocks this by supplying a hard-coded Just. It is hard to work around that restriction, because the RequestBuilderData type is not exported, even in the Internal module.

Note that this is not a problem for POST parameters, because of the postBody and setRequestBody functions.

Fixed by adding the addBareGetParam function in #1821 .