Skip to Content

Error processing request stream. JSON text specified is not valid | XSOData

Apr 05 at 03:05 PM


avatar image
Former Member

I am able to do a post with the XSODATA via postman client, however it wont work in the SAPUI5 application.

below is from postman.

Below is my code. I am using sap.ui.model.odata.ODataModel

with content-type" : "application/json;charset=utf-8"});

ap1.png (71.0 kB)
ap2.png (18.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member
May 10 at 03:25 PM

Pass the JSON object as a variable to make sure it is in the right format.

var oEntry = {}; 
oEntry.perno = "123456789";
oEntry.SID = "BHAT";
oEntry.tdate = "Apr 018";
oEntry.vecnumber = "Ino3x";

sap.ui.getCore().getModel().create('/Mileage', oEntry, null, 
   function (oResponse){
       console.log("Create successful");
   function (oError) {
       console.log("Create failed");

10 |10000 characters needed characters left characters exceeded