How can I access Request object in PostMan

Trung picture Trung · Nov 25, 2015 · Viewed 21.1k times · Source

As title, How can I access Request object in PostMan ? Is it possible to create a testcase like this

tests["Response content restaurant Id : ", req.body.restaurantId] = responseBody.has(req.body.restaurantId);

Answer

Trung picture Trung · Nov 25, 2015

After doing some research in Postman Sandbox

I finally found the answer for myself.

var reqBody = JSON.parse(request.data);
var resBody = JSON.parse(responseBody)
tests["Data"] = reqBody.restaurantId === resBody.restaurantId;