Sets the body of the current HTTP message to a static string or a computed expression. SpEL template expressions are supported by default; Groovy, JsonPath, and XPath are also available. For conditional output or loops, use the template interceptor instead. See tutorials/getting-started/65-SetBody.yaml.
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.