How to download a CSV file dynamically from a website (sharepoint / web site)

Postman team

I need to download a CSV file dynamically from 2 places such as 1. share point link 2. Website.
I am familiar with reading static CSV file through postman test. Is there a way to download the CSV file programmatically via postman tests ?

Thanks, Raje

var options = {
  'method': 'GET',
  'url': url_to_the_csv_file,
};
pm.sendRequest(options, (err, res) => {
  if (err || res.code !== 200) {
    // do some error handling
  }
  else {
    var csvContent = res.stream.toString();
  }
});
1 Like