Escape curly braces but inject a variable in it

Chris Weed
Wed, 16 Dec 2020 19:37:49 +0000
Help Hub

I have a somewhat unique situation. The API I’m testing takes {{ as part of the json body and uses it as a sort of macro.

I’d like to inject a variable into this macro, it looks like this without variables injected:

{
    "key": "Some text: {{DATE(2020-10-10T00:00:00.000Z),long}} some more text"
}

I’d like to be able to replace that date string with a Postman variable:

{
    "key": "Some text: {{DATE({{$TODAY}}),long}} some more text"
}

But it just sends the whole block of braces and doesn’t replace that date. Is there a way to escape the first curly braces or otherwise use a different technique to inject the variable?

2 posts - 2 participants