Skip to Content
Dec 18, 2018 at 09:38 AM

How to ready body output from xsjslib in UI5?


Hi All,

I'm trying to execute a POST operation using xsjslib exit. In the xsjslib file, I have written my logic and at the end I'm also setting a output in the body as below

$.response.contentType = "application/json";
$.response.contentType = "text/plain";

Also, the controller.js file looks like below

var body = JSON.parse($.request.body.asString());
			oThis.insertService.create("/user", userdata, {
				success: function(oData, result) {
				error: function(oError) {

Here my intention is to read the output set in the $.response.setBody("Done") in the console log. I have tried doing this using var body, but I'm not sure if this is the correct apporoach.

Pls help