@http:json.format
Construct a JSON string from a template and an array of values.
Returns: string
Syntax
Section titled “Syntax”@http:json.format(template values)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
template |
string |
Brace-wrapped template listing JSON object keys |
values |
array |
Values to substitute into template |
Examples
Section titled “Examples”# Build a JSON object from valuesset $body @json.format("{name, age}" ["Alice" 30])print $bodySee Also
Section titled “See Also”- @http:json — parse JSON strings
- @http:fetch — fetch a URL