i have any api end point which is going to translate the text in to speech . for single single language translation i am able to download the response through send and download button ,but i am trying to pass an csv file in a collection runner to run my request but it ll gives the response in an musical symbol format .My problem is i am not able to download that translation as a mp3 format .
Hi @pravinder i was able to download files using newman. If that is ok for you, suggest you to use that.
var i = 0,
fs = require(‘fs’),
newman = require(‘newman’); // ensure that you have run “npm i newman” in the same directory as this file
newman.run({
collection: require(‘./Test.postman_collection.json’),
}, function (err, summary) {
// handle collection run err, process the run summary here
}).on(‘request’, function (err, execution) { // This is triggered when a response has been recieved
if (err) { return console.error(err); }
fs.writeFile(response${i++}.pdf
, execution.response.stream, function (error) {
if (error) { console.error(error); }
});
});
Hi
Thanks for support . i will check it once and ll getback to you
@pravinder sorry, forgot to mention this. Save this code to a .js file and run the file from cmd using
node test.js
Remember to run npm i newman
in the directory where you run the collection.
Hi @jeevananthank
Its not working . i have to run my collection with environment variables .where should i stored all these ?
Hi @jeevananthank
Sorry not able to run . can you please explain me step by step so that i will do accordingly
Hi @jeevananthank,
Thank you for sharing your script. As far as I see, your script is the only way for downloading a pdf file via newman.
How can I pass a Bearer token in your script?
I checked the documentation but could not find a way for it.
@pravinder @jeevananthank : Hi, i have similar issue facing i.e not able to download .wav or mp3 format via collection. I am running a collection which is able to download the content (as symbols) however i would need to get in .wav file to play the audio. For this to work send with download when run the collection . Could you assist me what changes required in order to send with download work?