mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
How to implement a request body-dependent response? #32
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Yopt on GitHub (Jun 20, 2017).
Originally assigned to: @StefH on GitHub.
Dear @StefH,
consider request body contains complex data (xml as plain text) in a certain known format.
I have to create corresponding mock response by parsing body and transforming it using known rules.
Is it possible to implement this logic by means of WireMock?
Regards
@StefH commented on GitHub (Jun 20, 2017):
You can indeed use transformation wiki - response-templating using handlebars.
For example see:
4fa295edb7/test/WireMock.Net.Tests.old/ResponseTests.cs (L42)@Yopt commented on GitHub (Jun 22, 2017):
Fine, thank you