> I am trying to mimic a scenario where I have ...
# general
I am trying to mimic a scenario where I have mappings defined in json file with request and response and i want to inject variable delay. Variable delay is that i will pass a header with field "delay" and value anything like "2000" or "4000" which means 2sec or 4 sec and i want to use the header value in the "fixedDelay" attribute in the json mapping.
"fixedDelayMilliseconds" : "{{request.headers.delay \"type\":'NUMERIC'}}",
The problem is :- request.headers.delay contains string value and i am not able to convert to integer in json mapping.
fixedDelay attribute takes integer only.
What is the way to have variable delay inject from the postman request header ?
Hi @jagroop bhanot the only way you can do this at the moment is to write a response definition transformer extension and register it with WireMock at startup. Templates expansion isn’t currently enabled on all fields, just header and body values
Thank you @Tom for your reply.
👍 1