Dear Gateway Community,
I was wondering if it is possible to have the response of a Gateway batch request (READ only) using the gzip compression.
Indeed, I've noticed that after I had grouped my requests into a batch (just like best practices guides recommend), the payload went from 838Kb to 7.1 Mb because the response was not using any content-encoding.
I'm using the Data.js library used by SAP themselves and tried adding the Accept-encoding header parameter without succes.
var request = {
headers : {
"Accept-Encoding": "gzip, deflate"
},
requestUri : '/sap/opu/odata/sap/ZGW_SERVICE/flightCollection',
method : "GET"
};
var batchRequests = [request];
OData.request({
headers : {
"Accept" : "application/json",
"X-CSRF-Token" : token,
"Accept-Encoding": "gzip, deflate"
},
requestUri : '/sap/opu/odata/sap/ZGW_SERVICE/$batch',
method : "POST",
data : {
__batchRequests : batchRequests
}
}, function () {
console.log('success');
debugger;
}, function () {
console.log('failure');
}, OData.batchHandler);
Maybe that's got something to do with the fact that the response content type with batch requests is multipart/mixed.
Thanks in advance for any help on this matter,
Cheers,
Paul