Example Configuration
api:
port: 2000
flow:
- setBody:
value: |
Name: ${header.X-Name}
Method: ${method}
Path: ${path}
- return:
status: 200
api:
port: 2000
flow:
- setBody:
value: |
Name: ${header.X-Name}
Method: ${method}
Path: ${path}
- return:
status: 200
Syntax
setBody:
'$ref': <string>
contentType: <string>
language: groovy
value: <string>
xmlConfig: {}
setBody:
'$ref': <string>
contentType: <string>
language: groovy
value: <string>
xmlConfig: {}
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| $ref | false | - | Reference a component defined under components. | - |
| contentType | false | - | Content-Type applied to the message after the body is written. When set to a JSON media type, expression values are automatically escaped to prevent injection. When omitted, no escaping is applied. | application/json |
| language | false | SpEL | Scripting language used to evaluate the value expression. | SpEL | groovy | jsonpath | xpath |
| value | false | - | Body content to set, evaluated as a SpEL template expression by default. The result is encoded as UTF-8 bytes. | Name: ${header.X-Name} |
Child Structure
| Element | Cardinality | Description |
|---|---|---|
| xmlConfig | 0..1 | XML namespace declarations for XPath expressions in the value. |