How do I console the response status code in Postman ?
I have this snippet here:
JavaScript
x
4
1
pm.test("Status code is 200", function () {
2
pm.response.to.have.status(200);
3
});
4
I want to log response status code 200 if I get it.
Thank you in advance
Advertisement
Answer
JavaScript
1
2
1
console.log(pm.response.code)
2
you can get it from pm.response object in test script section