I'm using the following code
//build http request string using URL from Power Automate flow
var req = new XMLHttpRequest();
var url = "<<HTTP POST URL HERE>>";
//send https request to Power Automate
req.open("POST", url, true);
req.setRequestHeader('Content-Type', 'application/json');
req.setRequestHeader('Access-Control-Allow-Origin', '*');
req.send(courseupdate);
alert("updated");
However I'm now getting a 400 error in my chrome console.
I've literally lifted most of this from a source that say's it's correct (though I added the Access-Control-Allow-Origin myself)
Is there a reason why this isn't working?