Templates#
With template: true on a response, Simuhook renders the response body and header values as Go templates, injecting request-specific data into every response.
| Page | What it covers |
|---|---|
| Variables | Request data available inside a template: .UUID, .Now, .Body, and more. |
| Functions | Header, Query, RandomInt, RandomHex. |
| Faker Generators | 27 realistic random data generators: names, addresses, payment details, and more. |
| JSONPath | Extract fields from the JSON request body with {{JSONPath "$.user.name"}}. |
Quick Example#
id: order-created
method: POST
path: /webhooks/orders
response:
status_code: 200
template: true
headers:
X-Request-ID: "{{.RequestID}}"
X-Timestamp: "{{.Now}}"
body: '{"id":"{{.UUID}}","event":"order.created","timestamp":{{.Timestamp}},"method":"{{.Method}}","body":"{{.Body}}"}'Every request gets a fresh UUID, timestamp, and the request’s own method and body echoed back.