Hello, I have a question/request - I have made cal...
# general
j
Hello, I have a question/request - I have made callback/webhook stub in WM and it works but I am currently stuck on how to access needed data from original request header. I need to pass an id from original request header to callback but I have no idea how. In WM documentation I have found only examples of how to pass parts of request body using jsonpath. But as far as I know request header is not JSON so it cant be used. Can any1 help?
t
You should be able to use
{{{originalRequest.headers.X-My-Header}}}
j
Thank you! I will try it right now.
t
The
originalRequest
model is exactly the same structure as the
request
model used when templating responses, so all fields documented in https://wiremock.org/docs/response-templating/#the-request-model are available.
🙏 1
j
Okay, it seems its working now and id is being passed as intended. 😁
👍 2