Syntax
groovy:
location: <string>
src: <string>groovy: location: <string> src: <string>
Sample
<api port="2000">
<response>
<groovy>
header.add("X-Groovy", "Hello from Groovy!")
println("Status: ${message.statusCode}")
CONTINUE
</groovy>
</response>
<target url="https://api.predic8.de"/>
</api>
<api port="2000">
<response>
<groovy>
header.add("X-Groovy", "Hello from Groovy!")
println("Status: ${message.statusCode}")
CONTINUE
</groovy>
</response>
<target url="https://api.predic8.de"/>
</api>
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| location | false | N/A | A file or URL location where the content that should be set as body could be found | conf/body.txt |
| src | false | - | - | - |