Skip to Content
0
Feb 23, 2021 at 10:54 AM

jquery-dbg.js:10210 Failed to load resource: the server responded with a status of 403 (Forbidden)

150 Views Last edit Feb 23, 2021 at 05:49 PM 2 rev

Hello experts,

In SAPUI5 i m trying to post data using ajax call to the my backend java. but i am getting an error forbidden 403. GET method works fine . Here i define the code.

onSaveNote: function(oEvent) { var oTextArea = oView.byId("idnote").getValue(); console.log(oTextArea); var uploadAttachUrl = "/vendorSpringRest/addnote"; var myKeyVals = { note: oTextArea }; $.ajax({ type: "POST", url: uploadAttachUrl, data: myKeyVals, contentType: 'application/json; charset=utf-8', processData: false, success: function(data) { console.log("success" + data); }, error: function(e) { console.log("error: " + e); } }); }

I tried , headers: { "X-CSRF-Token": "Fetch" } but still its not work