I'm trying to use methodOverride from the wai-extra package (module Network.Wai.Middleware.MethodOverride), which rewrites POST requests that have a _method parameter to contain the correct HTTP method, e.g., DELETE.
I've added middleware methodOverride to my list of handlers, but it doesn't work. The reason for this seems to be that, internally, methodOverride uses queryString (from Network.Wai) to extract the _method parameter of the Request, but I noticed that in the passed Request the query string is empty for some reason.
That said, _method and the other parameters that I'm passing do show up when I query them later on with param in ScottyT, so it seems that Scotty somehow has removed them from Request but keeps track of them in its own state.
I'm trying to use
methodOverride
from the wai-extra package (module Network.Wai.Middleware.MethodOverride), which rewrites POST requests that have a_method
parameter to contain the correct HTTP method, e.g., DELETE.I've added
middleware methodOverride
to my list of handlers, but it doesn't work. The reason for this seems to be that, internally,methodOverride
usesqueryString
(from Network.Wai) to extract the _method parameter of theRequest
, but I noticed that in the passedRequest
the query string is empty for some reason.That said,
_method
and the other parameters that I'm passing do show up when I query them later on withparam
inScottyT
, so it seems that Scotty somehow has removed them fromRequest
but keeps track of them in its own state.