Hi,
I would like to call HANA XSJS service from UI5 using the method POST to send some JSON data message body.
I did it like this:
var aUrl = "/url/service.xsjs";
var oButton = new sap.ui.commons.Button({
text: "Create",
press: function(oEvent){
jQuery.ajax({
url : aUrl,
method : 'POST',
dataType : 'json',
data : jsonData,
success : function(result){alert('OK');},
error : function(jqXHR, textStatus, errorThrown){alert('NOT OK');}});
}
});
The service is called but I don't know how to aceess the data in the xsjs code. I tried
var json = $.request.body; but that did not work.
Any idea what I do wrong? Or an example?
Thanks and Regards,
Alex