Reputation: 41
Can anyone let me know how to set and get the 'request.data' into a global variable as I am intended to access the request body of a post request in a subsequent get request later?
I tried the below, but this is not working.
pm.globals.set("reqBody", JSON.parse(request.data));
pm.expect(response.name).to.equal(pm.globals.get(reqBody.pr_practice_name))
Upvotes: 3
Views: 908
Reputation: 41
As Chris G replied above, the following resolved my issue:
pm.globals.get("reqBody").pr_practice_name
Upvotes: 1