Slackbot
02/17/2023, 6:26 AMRob Elliot
02/17/2023, 9:34 AMContent-Type
header & the body:
stubFor(
get(urlEqualTo("/some/thing"))
.withHeader("Content-Type", equalTo("application/x-www-form-urlencoded"))
.withRequestBody(containing("foo=bar"))
.willReturn(aResponse())
);
If you need to use the values in the response have a look at "Form helper" under https://wiremock.org/docs/response-templating/ .Rob Elliot
02/17/2023, 9:39 AM.withRequestBody(
matchingFormKey("foo", equalTo("bar))
)
You could have a look at MatchesJsonPathPattern
as an example of how to do it.