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響應體 –