Updated Response Templating (markdown)

Stef Heyenrath
2021-04-26 17:51:25 +02:00
parent 7fa474c140
commit 1d5beaa795

@@ -5,6 +5,25 @@ Response headers and bodies can optionally be rendered (templated) with:
This enables attributes of the request to be used in generating the response e.g. to pass the value of a request ID header as a response header or render an identifier from part of the URL in the response body. To use this functionality, add `.WithTransformer()` to the response builder.
## Way-Of-Working
## 1. Define "Handlebars template"
``` handlebars
Hello {{firstname}}
```
## 2. Data
``` c#
var user = new
{
firstname = "Stef"
}
```
## 3. Result
``` c#
Hello Stef
```
### C# Example for using Handlebars.Net :
```csharp
var server = WireMockServer.Start();