Closed Microcom-Bjarne closed 10 months ago
This is the normal INDY behavior: the "body" of the method which could provide a body but don't, returns the querystring parameters as key/value strings pair. Do not rely on this because a different engine could have a different behaviour. Please follow the Robustness Principle.
Hi.
Using latest - DMVC :) on Delphi 11.3
I don't understand why I get my querystring parameters placed inside my body part when using GET, DELETE or OPTIONS. I do not use OPTIONS anywhere - but I tested it, since I could :)
Slightly modifying the MiddlewareSamples.dpr sample application.
Consider this controller endpoint.
with this implementation.
And using postman and calling the endpoint with the allowed verbs results in:
GET : par1=true DELETE : par1=true OPTIONS : par1=true POST : PUT : TRACE : PATCH : HEAD :
I tried the app - without the middleware. Same result. So it has nothing to do with the middleware. I also tested with pathparams - and all verbs return empty body, as I would expect.
I'm building my own middleware for logging purpose. And it broke on some occasions where I used querystring parameters. And that is why I started looking into why it broke.
Anyone know if this is expected behaviour? Is it coming from INDY or is it a bug i DMVC?