Closed ocramz closed 3 months ago
NB remember to import http-api-data
for the decoding functionality : https://hackage.haskell.org/package/http-api-data
Regarding path segment inputs, they are already decoded by WAI/Warp in Request.pathInfo
. Same goes for queryParams
I believe #262 is fixed by #302
I just created my first PR at #392 :)
Basically path segments, query parameters and form data are handled by warp
and therefore already decoded when they are accessed by scotty
actions. When using warp
, path segements are ultimately handled by Network.HTTP.Types.decodePathSegments
and parameters are handled by Network.HTTP.Types.parseQuery
. Both of those call Network.HTTP.Types.urlDecode
internally. I added some tests for that.
And like the other PR, I added a formData
action that can decode records with FormData
instances from http-api-data
.
related : #8
closes #170