I am trying to do an API call to my own server using an Add In on Excel.
This is the code I am using :
var xhr = new XMLHttpRequest();
xhr.open('POST', 'myurl');
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Access-Control-Allow-Origin", "*");
xhr.withCredentials = true
xhr.send(JSON.stringify({
MYJSON
}))
I keep receiving the error :
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Refused access.
Do you know what I am supposed to do ? I suspect it is a problem with CORS however I am using services from AWS and I enabled CORS on API gateway.
It has been several days that I am searching, I have added my domain in the XML of the application but it does not work.
Do you know what I am supposed to do ? Thanks a lot!!
User contributions licensed under CC BY-SA 3.0