Hi Guys,
i am currently trying to write my own Excel Exporter on the result set of an OData request.
Therefore i have a HttpDest to localhost (yes, the HANA itself) to be able to query the same HANA OData result
like the SAPUI5 ODataModel is getting.
Every thing works as expected, but the resulting output seems to double UTF-8 escape the body content!!!
Can anybody confirm that this is a bug in SP85?
I am doing something like
var client = new $.net.http.Client();
var dest = $.net.http.readDestination("uo.wp.app.pm.services", "localhost");
var request = new $.net.http.Request($.net.http.GET, sOdataServiceUrl);
//request.contentType = 'application/json'); // also does not help
// copy user SSO cookies
for (var c in $.request.cookies) {
var cookie = $.request.cookies[c];
request.cookies.set(cookie.name, cookie.value);
}
client.request(request, dest);
var response = client.getResponse();
var body = JSON.parse(response.body.asString());
// now manipulating the oData object from HANA ...
// serialize the oData object back to string
$.response.contentType = "application/json"; // default is UTF-8 but declaring also does not help!
$.response.setBody(JSON.stringify(body));
Cheers Holger