How to extract the data .json.gz using axios+pako?

The following code gives the error "Uncaught (in promise) incorrect header check":
axios({
method:'get',
url:'https://files.tmdb.org/p/exports/keyword_ids_03_30_2019.json.gz',
responseType:'stream'
})
 .then(function(response) {
 console.log(pako.ungzip(response.data,{ to: 'string' }))
});
March 19th 20 at 09:22
1 answer
March 19th 20 at 09:24
Solution
Found the solution!

axios({
method:'get',
url:'https://files.tmdb.org/p/exports/keyword_ids_03_30...',
responseType:'arraybuffer'
})
.then(function(response) {
console.log(pako.ungzip(response.data,{ to: 'string' }))
});
- Dayana.Hartmann commented on March 19th 20 at 09:27

Find more questions by tags Web DevelopmentJavaScript