0
Parse.Cloud.httpRequest如何处理压缩?Parse.Cloud.httpRequest响应gzip膨胀/解压
在parse.com,我从未有过的问题与接受一个XML文件,但使用不同的主机(back4app)的解析服务器,我httpResponse.text是负载:
�E��ڇ�*q�������y���v^�����
Parse.Cloud.job("fetchData", function(request, status) {
Parse.Cloud.httpRequest({
method: 'GET',
url: 'http://example.com/test.xml',
headers: {
'Accept': 'application/xml',
'Accept-Encoding': 'gzip, deflate'
},
success: function (httpResponse) {
console.log("SUCCESS RECD FILE: " + httpResponse.text);
},
error: function (httpResponse) {
console.log('An error has occured with the http request.: ' + httpResponse);
}
});
}
分析是不是一个网络服务器,我想你应该在你的nginx或Apache配置它... –
尝试处理一个zip'd响应.... http://stackoverflow.com/questions/12148948/怎么办-I-ungzip - 解压缩-A-的NodeJS,请求模块,用gzip响应体 –