I am trying to call the POST REST API from the office outlook web add-in using ajax calls, for target url Configured the app domains in the manifest.xml file but I am facing same CORS issue.
Access to XMLHttpRequest at 'https:' from origin 'https:' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.
I couldn't find the reason and what is wrong with it.
MessageRead.js code
$.ajax({
type: "POST",
dataType: "json",
url: "<target url>",
contentType: 'application/json',
crossDomain: true,
headers:
{
'X-Database': 'aln_template',
},
data: {
//id: "1598521065618",
id: (new Date()).getTime(),
method: "execute",
params: params
},
success: function (data1) {
}
});