Already a request body is being attached from code...
# wiremock-java
d
Already a request body is being attached from code wiremock is written as request & response json separate How can I change a parameter of request body in wiremock request json? @Bas Dijkstra
b
I don’t think I fully understand the question. What do you mean by ‘already a request body is being attached from code’ and ‘how can I change a parameter of request body in wiremock request json’? WireMock listens to incoming requests and responds to them. Can you give an example? Maybe that helps clarify the question.
d
I have my request & response configured at wiremock service as below- req: { "request": { "method": "POST", "urlPathPattern": "/wiremock/end1”, "bodyPatterns": [ { "matchesJsonPath": { "expression": "$.endToEndId", "matches": "^T(.*)$" } } ] }, "response": { "status": 200, "bodyFileName": “folder1/response.json”, "headers": { "Content-Type": "application/json; charset=utf-8" } } } resp: { “response”: [ { }] } my question is, as this wiremock will listen for this request format. Would I be able to change upcoming request body's one of the key to another value before actual api call happens?
working as expected, thanks for help!!
🙌 2