User: I'm having real issues drilling down into a pm.sendRequest response header in a pre-request script. Syntax like res.header[x].value barfs in postman (the value is there, though), while the same JSON object in the browser console is fine. Known issue? #testing
Postman: The response you get in the callback is not a plain javascript object. It is a postman-collection response instance. You can find the API reference here https://t.co/rxLc4yFlo8
pm.sendRequest('http://postman-echo.com', function (err, res) {
console.log(res.headers.toObject());
});
It doesn’t communicate the caveat with the response type. But it points to the link for the right response type.