Skip to content

@http:json.format

Construct a JSON string from a template and an array of values.

Returns: string

@http:json.format(template values)
Name Type Description
template string Brace-wrapped template listing JSON object keys
values array Values to substitute into template
# Build a JSON object from values
set $body @json.format("{name, age}" ["Alice" 30])
print $body