Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

Read body in XSJS

$
0
0

Dear Experts,

 

I post a request in fiori with following code:

addJob: function () {  var oJsonData = {  "JOBID":"JB9006",  "DESCRIPTION":"AddJob9006",  "DEPARTMENT":"AddDep.",  "VALID_TILL":Date.now()  };  $.ajax({  url:this.getView().getModel().sServiceUrl.substr(0,35)+"/update.xsjs?$mode=ins",  type:'POST',  contentType:'application/json',  data: JSON.stringify(oJsonData),  dataType:'json',  success: function(){alert("Update Success!");}  });  }

But in update.xsjs, I can't read body with follow command:

var sData = $.request.body.asString();

It's always undefined.

 

How to read body of the request?

 

By the ways, develop environment of xsjs is HCP Trial.

 

Thanks & Regards.

Chad


Viewing all articles
Browse latest Browse all 3363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>