This page shows an example of Variable Insertion in using stream consisting of the HTTP Client function.
Refer to the example and follow the steps to understand Variable Insertion:
Enter the JS code using the Script function. Example of a JS code snippet:
await push({ url: 'https://postman-echo.com', foo: 42, bar: 'kawaboom!', baz: payload.value % 2, someData: { alpha: 1337, beta: 'foobar' } })
Configure an HTTP request response in the following format. You can substitute the values of variables defined in the JS code snippet using ${variable} or @{variable}.
Note!
While configuring HTTP body, you must add the JSON objects within quotes (" ") . Applicable only for JSON objects that return value in the string format.
Using ${variable}
You are passing the url value as postman-echo.com and you will see the following response:
Output in the table format
Output in the tree format
Using @{variable}
You can also use @{} for variable substitution as shown:
Output in the table format
Output in the tree format