Hi Team, Is there any feature in slack which enabl...
# announcements
s
Hi Team, Is there any feature in slack which enables us to fetch the data dynamically in header parameters. Thanks.
t
Hi @Shruti Mishra, in slack or in WireMock? If WireMock, do you mean grabbing data from request headers to use in the response?
s
Hi @Tom In wiremock, in the header section section, just wanted to know about this approch whether it is doable. "Key": ${value will be coming dynamically} We want to fetch the values coming dynamically, and validate the content inside the value. Here two steps are involved 1. Fetching the values dynamically. 2. Validating the content in order to proceed further.
t
Request headers or response?
s
@Tom Request headers
t
OK, request headers aren’t in the templating system so if you wanted to modify those dynamically you’d need to write an extension class. Probably the type you’d need is
StubRequestFilter
. See here for an example of how to implement one of these: https://github.com/wiremock/wiremock/blob/master/src/test/java/com/github/tomakehurst/wiremock/RequestFilterAcceptanceTest.java#L204
s
@Tom Sure. Thanks, will try this one.
👍 1