Endpoint downloads PDF. How to do this via Collection Runner or Newman?

Hey @russellg,

I know it’s basic but would this help if you’re running it with Newman as a library?

const newman = require('newman'),
      fs = require('fs');

newman.run({
  collection: '<Collection File>'
}).on('request', (err, args) => {
  fs.writeFileSync(`./${args.item.name}.pdf`, args.response.stream, 'binary');
})

I was just using this Dummy request that returned a PDF and it seemed to work:

2 Likes