https://linen.dev logo
Title
j

Jakub S

03/31/2023, 1:27 PM
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

Tom

03/31/2023, 1:38 PM
You should be able to use
{{{originalRequest.headers.X-My-Header}}}
j

Jakub S

03/31/2023, 1:39 PM
Thank you! I will try it right now.
t

Tom

03/31/2023, 1:40 PM
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

Jakub S

03/31/2023, 1:49 PM
Okay, it seems its working now and id is being passed as intended. 😁
👍 2