In Postman, I want to pass a dynamic JSON string to a variable and use it in a request. This is what I have:
Pre-request:
var myJsonString = "{ \"type\": \"10\", \"number\": \"123456\" }";
pm.variables.set("my-json-string", myJsonString);
Body:
"body":{
"jsonString":"{{my-json-string}}"
}
But this does not work. Do you know any solution for this?
If I send the request like this, it works perfect:
"body":{
"jsonString":"{ \"type\": \"10\", \"number\": \"123456\" }"
}