-
-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
previous value of variable used in JSON body #2303
Comments
I have seen seen similar problem, when trying to set the env variable that is used in the body, with a pre-request script. It appears that the pre request script is NOT preceeding the body construction. The pre request script should preceed everything in the request, even the construction of the request itself, including body and headers etc. Otherwise the full potential of the pre request script is not there |
@frille700 I get your point. But executing the pre-request script directly before the execution of the request has the advantage, that you can work with the fully prepared request. |
And it relates to #2249. However, this issue describes the opposite... |
Yes I have realized the advantages with the pre request too. I got it to work by using the req.setBody in the pre request script and that way was able to set what I wanted. But, as you point out, it would be neat with a pre-prepare-request kind of thing |
Similar issue with variables in the URL segment. |
thanks @frille700 - this is a workaround I can work with |
This, in particular, has broken all my collections. Is the intention to remove that capability entirely? If not, how would you set those before the request now? |
@VeselovAndrey: I'm getting the same issue. Downgrading to version |
This can be dangerous if you are doing operations in a production environment. |
@applepies @frille700 @VeselovAndrey @lewg @fburato @marfranke @luisdosreis This issue has been fixed in v1.18.0. Could you please verify and let me know if you're still facing any issues? |
@lohxt1 Did a quick test with 1 request and 2 different values in a URL segment - see no issues. |
Can confirm that it seems fixed in v1.18.0. |
I have checked the following:
Describe the bug
When using variables inside a JSON body, upon executing the request, the body sent contains the previous value of the variable
Repro:
POST
, https://www.example.com{ "foo": "{{bar}}" }
as the bodybar
with value123
> data {"foo":"123"}
in the Timelinebar
to1234
> data {"foo":"123"}
in the Timeline> data {"foo":"1234"}
in the Timeline.bru file to reproduce the bug
example.zip
Screenshots/Live demo link
The text was updated successfully, but these errors were encountered: