Tanyagorn Benjaprompadung
01/30/2023, 12:47 PMTom
01/30/2023, 12:53 PMHost
header in the set of captured headers.
For playback you can either continue to use forward proxying or configure a DNS alias for each target hostname you’ve recorded from.java -jar wiremock-jre8-standalone-2.35.0.jar \
--enable-browser-proxying \
--local-response-templating
Make some requests to varying domains (note we do this before recording, since we’re using the snapshot feature):
curl -v -k --proxy-insecure \
--proxy localhost:8080 <https://api.github.com/users>
curl -v -k --proxy-insecure \
--proxy localhost:8080 <https://wiremock.org/docs/>
Take a snapshot (essentially recording everything that’s already in the request log):
curl -v <http://localhost:8080/__admin/recordings/snapshot> -d '{
"captureHeaders": {
"Host" : {
"caseInsensitive" : true
}
}
}'
Now if you check your stubs you’ll see you’ve got one for each request with host header matching configured:
curl <http://localhost:8080/__admin/mappings>
Tanyagorn Benjaprompadung
01/30/2023, 2:34 PMTom
01/30/2023, 3:32 PMTanyagorn Benjaprompadung
01/31/2023, 10:17 AMTom
01/31/2023, 10:18 AMTanyagorn Benjaprompadung
02/01/2023, 7:31 AM