Admittidly, I've never used CORS before and am not fully sure what I'm doing.
I'm trying to call a Lambda function from a website without having to go through JSONP for cross-origin requests. I tried following this tutorial for enabling CORS through the API gateway, but it doesn't seem to work. I created a GET method, tested that it worked through Postman, and then used the enable CORS option from the action drop down menu. I'm sending the request using AJAX as follows
$.ajax({
url: myEndpoint,
type: "GET",
crossDomain: true,
dataType: "json",
})
And in response I'm getting the error
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access"
Does anyone know how to correct this issue?