This request return a Ziped File, with a XML file inside of it.
myXMLText = ''
request({
url: "http://webservice.newrastreamentoonline.com.br/",
method: "POST",
headers: {
"content-type": "application/xml", // <--Very important!!!
},
body: myXMLText
}, function (error, response, body){
//console.log(body);
})
.pipe(fs.createWriteStream('rastreamento.zip'))
I wanna open the zip file, read the XML file, and parse the content to this function on the XML variable
var result = convert.xml2js(xml,{alwaysChildren: true});
How can I do it?
Works on the hard way.
Have to decompress the file, read it, and it works.
I think there is a better solution, but for now, it works