on 12-18-2018 9:38 AM
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";
$.response.setBody("Done");
}
Also, the controller.js file looks like below
var body = JSON.parse($.request.body.asString());
oThis.insertService.create("/user", userdata, {
success: function(oData, result) {
console.log(body);
},
error: function(oError) {
console.log(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
In general you can do such things in an xsjslib too, if you make the $.reponse object available in your xsjslib function. But it is not possible in the context of an XSOData exit implementation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.