insomnium icon indicating copy to clipboard operation
insomnium copied to clipboard

Cannot POST or PUT with strings containing {{double curly brackets}}

Open designbyadrian opened this issue 1 year ago • 1 comments

Expected Behavior

Hello, we're using string replacements in our API, and fields in our JSON data can contain strings with curly brackets.

In the example below, the data looks like this

"name": "{{My First Group}}",

Actual Behavior

Insomnium interprets these as environment variables and blocks me from submitting requests.

What's rendered on screen below:

image

Reproduction Steps

Have JSON data. Make a field a string containing template literal. Try POST or PUT.

Is there an existing issue for this?

Additional Information

No response

Insomnium Version

0.2.2

What operating system are you using?

macOS

Operating System Version

macOS Sonoma

Installation method

Download from GitHub

Last Known Working Insomnium version

No response

designbyadrian avatar Oct 30 '23 13:10 designbyadrian

This is actually a nunjucks issue, that I had come across a few months back when using insomnia. It's super counter-intuitive, but if you wrap the whole variable block in single quotes, and then again in {{}}, it will send the whole thing as a literal. In your case it should look something like: {{'{{My First Group}}'}}

It will complain, and insomnia/m will not render it correctly because it's confused, but it should send in the body correctly.

CodingMomentum avatar Nov 22 '23 14:11 CodingMomentum