smocker
smocker copied to clipboard
application/x-www-form-urlencoded body matcher
I have a use case for mocking third-party API where data is sent with POST via body in application/x-www-form-urlencoded
format.
It seems Smocker is pretty flexible in terms of various matchers for individual JSON keys but matchers for urlencoded params is not supported.
So far my workaround looked the following:
- request:
method: POST
path: "/test"
headers:
Content-Type: application/x-www-form-urlencoded
body:
matcher: ShouldEqual
value: username=${username}&password=${password}
response:
status: 200
headers:
Content-Type: application/json
body: >
{
}
However, this solutions relies on order of the params which should not be relevant.
Would you consider adding support for urlencoded body matching?
Yep, that should be a supported feature.
We'll try to implement this asap :)
Hi! Is there maybe any news here?
Added in 0.18.4