Currently, I am attempting to retrieve and read a JSON file that is stored in data.gz using AngularJS's $http service. However, when I make the request, all I get back are strange symbols and characters as the response. My application is being run locally on a Node.js server. Is there something I am overlooking in this process?
$http({
url: 'systemRes.10.gz',
method: 'GET'
})
.then(function successCallback(response) {
console.log(response.data); //displays unexpected characters
});
Click here to see the bizarre characters.
Given that the file is located in a local directory, if I try to set headers like below, it generates an error message: Refused to set unsafe header "Accept-Encoding"
headers: { 'Accept-Encoding': 'gzip' }