Skip to content

Is there any way to escape a variable template in a string? #2425

Answered by jcamiel
k33nice asked this question in Q&A
Discussion options

You must be logged in to vote

Hi k33nice, it's not pretty for the moment, you can use unicode JSON literal :

  • {=> \u007b
  • }=> \u007d

So instead of

POST https://foo.com
{ 
 "foo": "{{bar}}"
}

You can write:

POST https://foo.com
{ 
 "foo": "\u007b\u007bbar\u007d\u007d"
}

If you can test it on your side, I'm curious if it's working.

We've an issue to introduce a "raw" multiline string that won't do any variable resolution:

#1733

With this we should be able to write:

POST https://foo.com
Content-Type: application/json
```raw
{ 
 "foo": "{{bar}}"
}
```

We'll try to improve this!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@k33nice
Comment options

Answer selected by k33nice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants