I need to know how to pass authorization values in sap.ui.model.json.JSONModel
-> loadData()
method
API reference I am trying to execute this -
var uri = "https://sapes4.sapdevcenter.com/sap/opu/odata/IWBEP/GWDEMO/ProductCollection?$format=json";
var ojsonModel = new sap.ui.model.json.JSONModel();
var oHeaders = {
"Authorization": {
"Basic": btoa('P1940678860' + 'rahul123')
}
};
ojsonModel.loadData(uri, null, true, "GET", null, false, oHeaders);
console.log(ojsonModel);
I am getting error 401 (Unauthorized)