Skip to content
Advertisement

How to log response status log in postman

How do I console the response status code in Postman ?

I have this snippet here:

pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});

I want to log response status code 200 if I get it.

Thank you in advance

Advertisement

Answer

console.log(pm.response.code)

you can get it from pm.response object in test script section

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement