[GH-ISSUE #1834] can't use an environment variable in request body #583

Closed
opened 2026-03-16 16:08:50 +03:00 by kerem · 15 comments
Owner

Originally created by @sbocahu on GitHub (Sep 23, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1834

Describe the bug
environment <> should be useable within a raw request body, but it isn't

To Reproduce
create an env variable, eg "user"
use it (<>) into url: it works
use it (<>) into the raw request body textarea: it is not replaced with var content

Expected behavior
<> should be replaced with env var content

Screenshots
image

Desktop (please complete the following information):
chrome

Originally created by @sbocahu on GitHub (Sep 23, 2021). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1834 **Describe the bug** environment <<variable>> should be useable within a raw request body, but it isn't **To Reproduce** create an env variable, eg "user" use it (<<user>>) into url: it works use it (<<user>>) into the raw request body textarea: it is not replaced with var content **Expected behavior** <<user>> should be replaced with env var content **Screenshots** ![image](https://user-images.githubusercontent.com/929169/134485341-41ac29aa-e420-40e9-8237-f8e83339143a.png) **Desktop (please complete the following information):** chrome
Author
Owner

@liyasthomas commented on GitHub (Sep 23, 2021):

@zecrazytux thank you reporting this behaviour. We'll be taking a look into this as soon as possible.

<!-- gh-comment-id:925653805 --> @liyasthomas commented on GitHub (Sep 23, 2021): @zecrazytux thank you reporting this behaviour. We'll be taking a look into this as soon as possible.
Author
Owner

@dhivyasreedhar commented on GitHub (Sep 29, 2021):

Hi, can I work on this issue?

<!-- gh-comment-id:929840180 --> @dhivyasreedhar commented on GitHub (Sep 29, 2021): Hi, can I work on this issue?
Author
Owner

@liyasthomas commented on GitHub (Sep 29, 2021):

Hi @dhivyasreedhar, thanks for showing interest in working on this issue. You're free to take up this. I'm assigning it to you, contact us if you need any help.

<!-- gh-comment-id:929841220 --> @liyasthomas commented on GitHub (Sep 29, 2021): Hi @dhivyasreedhar, thanks for showing interest in working on this issue. You're free to take up this. I'm assigning it to you, [contact us](https://github.com/hoppscotch/hoppscotch#support) if you need any help.
Author
Owner

@rishabhkalra96 commented on GitHub (Oct 4, 2021):

Hi @liyasthomas, Is this issue still been looked into?
I'd like to take this up if @dhivyasreedhar is no longer working on it.

<!-- gh-comment-id:933143786 --> @rishabhkalra96 commented on GitHub (Oct 4, 2021): Hi @liyasthomas, Is this issue still been looked into? I'd like to take this up if @dhivyasreedhar is no longer working on it.
Author
Owner

@liyasthomas commented on GitHub (Oct 4, 2021):

Hi @rishabhkalra96, I guess you can pick up this, thanks for showing interest on contributing to Hoppscotch.

<!-- gh-comment-id:933144719 --> @liyasthomas commented on GitHub (Oct 4, 2021): Hi @rishabhkalra96, I guess you can pick up this, thanks for showing interest on contributing to Hoppscotch.
Author
Owner

@rishabhkalra96 commented on GitHub (Oct 6, 2021):

Hi @liyasthomas Based on my primary investigation i think its not a bug but an enhancement. The expectation we have from the raw body is not implemented yet. I could be wrong, would love to have some guidance here.
Also, of note, i am just starting off with OSS and vue specifically, so i might take little bit more time than expected.

Also, can you please tell me which is the current branch for development ? Although i have come here from hacktoberfest, but i want to contribute more into the product outside of the fest too.

<!-- gh-comment-id:936567938 --> @rishabhkalra96 commented on GitHub (Oct 6, 2021): Hi @liyasthomas Based on my primary investigation i think its not a bug but an enhancement. The expectation we have from the raw body is not implemented yet. I could be wrong, would love to have some guidance here. Also, of note, i am just starting off with OSS and vue specifically, so i might take little bit more time than expected. Also, can you please tell me which is the current branch for development ? Although i have come here from hacktoberfest, but i want to contribute more into the product outside of the fest too.
Author
Owner

@liyasthomas commented on GitHub (Oct 9, 2021):

Hi @rishabhkalra96, you can create a branch with main as the base. Also, raise the PR to the main branch as well.

And yes, environment support in the body is not a bug but rather an enhancement that hasn't been implemented. Let me know if you've any specific doubts from the codebases or in Vue.js - happy to help.

<!-- gh-comment-id:939209776 --> @liyasthomas commented on GitHub (Oct 9, 2021): Hi @rishabhkalra96, you can create a branch with `main` as the base. Also, raise the PR to the main branch as well. And yes, environment support in the body is not a bug but rather an enhancement that hasn't been implemented. Let me know if you've any specific doubts from the codebases or in Vue.js - happy to help.
Author
Owner

@0xc0Der commented on GitHub (Nov 12, 2021):

shouldn't this be closed?

<!-- gh-comment-id:967179334 --> @0xc0Der commented on GitHub (Nov 12, 2021): shouldn't this be closed?
Author
Owner

@widdlepaws commented on GitHub (Dec 9, 2021):

hello :) when can we expect it to be delivered ? really looking forward to it !
Last release got packaged too early :') https://github.com/hoppscotch/hoppscotch/releases/tag/v2.1.0

<!-- gh-comment-id:989790929 --> @widdlepaws commented on GitHub (Dec 9, 2021): hello :) when can we expect it to be delivered ? really looking forward to it ! Last release got packaged too early :') https://github.com/hoppscotch/hoppscotch/releases/tag/v2.1.0
Author
Owner

@liyasthomas commented on GitHub (Dec 9, 2021):

This feature is already live on the production deployment: Hoppscotch.io. You can fetch the latest tag if you're on Docker or fetch the latest main branch from Git to enjoy the latest changes.

<!-- gh-comment-id:989849156 --> @liyasthomas commented on GitHub (Dec 9, 2021): This feature is already live on the production deployment: Hoppscotch.io. You can fetch the `latest` tag if you're on Docker or fetch the latest `main` branch from Git to enjoy the latest changes.
Author
Owner

@widdlepaws commented on GitHub (Dec 9, 2021):

ah ok I now see that it works ! Just expected it would change color or pop up or something 😅
Thank you !

<!-- gh-comment-id:989870293 --> @widdlepaws commented on GitHub (Dec 9, 2021): ah ok I now see that it works ! Just expected it would change color or pop up or something 😅 Thank you !
Author
Owner

@humbertoarizah commented on GitHub (Mar 28, 2022):

Hi, I know this issue is already closed, but I tried to access to env variables within the body and it has been impossible. I have this notation in the body, for example:
{"account" : {
"username": "<>",
"email": "<>"
}}
And my response is not taking the env variables but the string (<>).
I don´t know if I´m doing anything wrong.
I would appreciated any help.

<!-- gh-comment-id:1080881377 --> @humbertoarizah commented on GitHub (Mar 28, 2022): Hi, I know this issue is already closed, but I tried to access to env variables within the body and it has been impossible. I have this notation in the body, for example: {"account" : { "username": "<<new-username>>", "email": "<<new-email>>" }} And my response is not taking the env variables but the string (<<new-username>>). I don´t know if I´m doing anything wrong. I would appreciated any help.
Author
Owner

@AndrewBastin commented on GitHub (Mar 31, 2022):

@humbertoarizah you have gotten the syntax wrong. Environment Substituions are represented by using <<ENV>> where ENV is the desired environment variable.

<!-- gh-comment-id:1084279292 --> @AndrewBastin commented on GitHub (Mar 31, 2022): @humbertoarizah you have gotten the syntax wrong. Environment Substituions are represented by using `<<ENV>>` where `ENV` is the desired environment variable.
Author
Owner

@tripol commented on GitHub (Apr 8, 2022):

@humbertoarizah you have gotten the syntax wrong. Environment Substituions are represented by using <<ENV>> where ENV is the desired environment variable.

Hi I tried following the <<ENV>> syntax and even though the color code confirms it is correct, I don't get the desired result.

image

But when I type out the full URL instead (that is without the <<ENV>> syntax, I get the correct result.

Please any idea why?

<!-- gh-comment-id:1092495772 --> @tripol commented on GitHub (Apr 8, 2022): > @humbertoarizah you have gotten the syntax wrong. Environment Substituions are represented by using `<<ENV>>` where `ENV` is the desired environment variable. Hi I tried following the `<<ENV>>` syntax and even though the color code confirms it is correct, I don't get the desired result. ![image](https://user-images.githubusercontent.com/27914557/162378960-48a7a06b-2465-4a10-aa4d-7df23d92617e.png) But when I type out the full URL instead (that is without the `<<ENV>>` syntax, I get the correct result. Please any idea why?
Author
Owner

@GuilhermeViterboGalvao commented on GitHub (May 27, 2022):

Same problem as @tripol !

<!-- gh-comment-id:1139636088 --> @GuilhermeViterboGalvao commented on GitHub (May 27, 2022): Same problem as @tripol !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#583
No description provided.