When creating my oModel, how to I ensure that the CSRF token will be returned so it will be available for subsequent POST's.
I was reading this article:
Specfically point #3 "Advice 3: To fetch the CSRF token, use a least resource intensive call. Think about using ODataModel to avoid this call all together."
I have tried a few methods but don't seem to be able to pull the CSRF token out after I create my model. Here is how I am creating the model:
var sServiceUrl = "<server>/sap/opu/odata/sap/<service>/";
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, false, "<uname>", "<pword>"); //removed mHeaders and bTokenHandling
In the above case I am not passing the extra parameters mHeaders and bTokenHandling beacause I could not get them to work for me, any thoughts how how the oModel create is setup so that the csrf token would be available right after its built?
Thanks, Mike