Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access Request object in PostMan

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); 
like image 656
Trung Avatar asked Nov 25 '15 10:11

Trung


People also ask

How do you check a request in Postman?

To write your first test script, open a request in Postman, then select the Tests tab. Enter the following JavaScript code: pm. test("Status code is 200", function () { pm.


1 Answers

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; 
like image 140
Trung Avatar answered Oct 01 '22 09:10

Trung