const xlsx = require("xlsx");
const requestretry = require("requestretry");
let response = await requestretry({
url: "https://dummy.com/filename",
json: false,
headers: { Authorization: token },
maxAttempts: 5,
retryDelay: 5000,
retryStrategy: requestretry.RetryStrategies.HTTPOrNetworkError
})
const workbook = xlsx.read(response.body, { type: "buffer" });
exceldata = await xlsx.utils.sheet_to_json(
workbook.Sheets[workbook.SheetNames[0]], { range: 4, raw: false })
console.log(exceldata);// didn't get my excel data
when I use Postman's Send button to call that external api I receive a unicode chracters in respose tab
But when I use Postman's Send and Download button to call that external api I can get the xlsx file to save.
Now, I am able to replicate same unicode as in I am receiving with Postman's Send button in my NodeJS code using requestretry module but don't know what to do next.
I thought its a buffer and tried xlsx.read(response.body, { type: "buffer" }) but got wrong output.