Insomnia: [Question] Escaping environment variable

Created on 30 Jun 2017  路  1Comment  路  Source: Kong/insomnia

Hi guys!

Is there any way to escape environment variables?
For example, I have a POST method in which I need to specify a payload like this:

{
    "jobs": [
        {
            "id": "Job1",
            "logs": [],
            "type": "pbs",
            "resource": {
                "queue": "batch",
        "cmd": "qsub -d ~/{{kbaseDir}}/ ~/{{kbaseDir}}/{{u1}}/penguin.pbs -q {{kqueue}}"
            }
        }
    ],
    "connections": []
}

where, in the jobs[0].resource.cmd property, I need to specify a string with curly brackets, but I don't want that they are interpreted as environment variables.
I have also tried to add the {% and %} escapes characters, but without success.

Any suggestion?

Most helpful comment

For Nunjucks templating, you can escape things with the {% raw %}...{% endraw %} tag.

"{% raw %}qsub -d ~/{{kbaseDir}}/ ~/{{kbaseDir}}/{{u1}}/penguin.pbs -q {{kqueue}}{% endraw %}"

Since this use case is so common, you can also disable rendering of the request body in the request settings (last option).

image

>All comments

For Nunjucks templating, you can escape things with the {% raw %}...{% endraw %} tag.

"{% raw %}qsub -d ~/{{kbaseDir}}/ ~/{{kbaseDir}}/{{u1}}/penguin.pbs -q {{kqueue}}{% endraw %}"

Since this use case is so common, you can also disable rendering of the request body in the request settings (last option).

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fyb3roptik picture Fyb3roptik  路  4Comments

tmaiaroto picture tmaiaroto  路  4Comments

wimdecorte picture wimdecorte  路  3Comments

oliverjanik picture oliverjanik  路  3Comments

slashsbin picture slashsbin  路  4Comments