We’re using API Gateway and the request body needs to be stringified before sending. Right now, I the request body with a json under “raw” and the content-type of application/json.
I’ve tried using:
var body = {
name: 'Test'
};
pm.environment.set('req_body', JSON.stringify(body));
Then passing in {{req_body}}, but it’s coming in as the whole stringified object as a key with an empty value.
Any ideas in this particular scenario how to get this to work in Postman?
What if I only want one field to use this JSON, not the entire request body? e.g.
{
“SomeProperty”: “SomeValue”,
“JsonProperty”: {{jsonValue}}
}
How should I set the {{jsonValue}}?