You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the tracker for existing similar issues and I know that duplicates will be closed
Describe the Issue
When using variables within the raw body of a request sent as JSON, if the variable is passed within a string, I would expect the variable to escaped in the request.
Steps To Reproduce
Create an variable (environment or global), e.g. foo="\"
Create a request
Select "body" tab
Choose "raw"
Choose "JSON" from the dropdown
Add a JSON object to the body, e.g. { "foo": "{{foo}}" }
Open the code right sidebar panel ...via the sidebar icon [</>]
Inspect the request...
What I see:--data-raw '{ "foo": "\" }' ← backslash not escaped What I would expect:--data-raw '{ "foo": "\\" }' ← N.B. escaped backslash
Screenshots or Videos
Operating System
macOS
Postman Version
9.21.5
Postman Platform
Postman App
Additional Context?
No response
The text was updated successfully, but these errors were encountered:
For more context... this is avoidable by reading the foo var and writing it as an escaped string to a temp var via a pre-request script and then adding escapedFoo to the JSON body.
This would be inconsistent with vars being contextually escaped in the URL context (for example) though.
Is there an existing issue for this?
Describe the Issue
When using variables within the raw body of a request sent as JSON, if the variable is passed within a string, I would expect the variable to escaped in the request.
Steps To Reproduce
foo="\"
{ "foo": "{{foo}}" }
What I see:
--data-raw '{ "foo": "\" }'
← backslash not escapedWhat I would expect:
--data-raw '{ "foo": "\\" }'
← N.B. escaped backslashScreenshots or Videos
Operating System
macOS
Postman Version
9.21.5
Postman Platform
Postman App
Additional Context?
No response
The text was updated successfully, but these errors were encountered: