I want my pact server to return a custom response when making a POST call with Header Content-Type: application/x-www-form-urlencoded
.
However, the body of the POST call is not always the same, only a prefix remains constant.
For example, It has to return the same thing, whether I call it with body
input_text=LOGSomeStuffHERE
, or with input_text=LOGAnoutherStuff
(As you see, input_text=LOG
is the constant part)
This is what I have tried:
.uponReceiving("POST cusom body")
.path("/path")
.method("POST")
.headers(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.getMimeType())
.body("input_text=LOG*")
.willRespondWith()
.status(200)
...
Does PactDsl support some kind of body matching on the request part?