I wrote a simple lambda function that takes a JSON dictionary I was able to access it successfuly using curl:
curl -X POST -H "Content-Type: application/json" -d '{
"resource_id" : "zippo"
}' "<url of api gateway>"
But when I call it via javascript I get an error
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "<url of api gateway>", true);
xhttp.send(`{"resource_id": "barium"}`);
Access to XMLHttpRequest at '' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Not sure if the issue is with the api gateway/lambda or my poor javascript skills.