How to assign a request payload value to a variable

Hi @odanylewycz,

i figured it out by my self.I wanted to get a single value form the POST req. body and assign it to a variable in the Pre- req.

 var body = JSON.parse(request.data);
 console.log(body.listing.property.type);
 var type = body.listing.property.type;
 pm.globals.set("Prop_Type",type);

Thank you for your reply. I was searching for this for two days.I’m a newbie to POSTMAN

2 Likes