1
votes

i've made an api gateway with a lambda function, the api works fine over rest clients, and over browser. when i created a api key and made it obligatory for the post request, it works fine over rest client but no more over the browser, it sais

No 'Access-Control-Allow-Origin' header

this by knowing that all CORS are activated, and "X-Api-Key" is in the cors headers

1
You probably want to use stackoverflow.com/posts/45523133/edit to edit/update your question to show the code you're using to make the request, as well as show the full response you're getting in each case, including the response headers. - sideshowbarker
Possible duplicate of API Gateway CORS Issue - Alex R

1 Answers

-1
votes

Enable CORS in AWS API Gateway

from API Gateway choose the API resource or method and click on the Actions button, it will display a list of options. Select Enable CORS options from the options and deploy the API by choosing Deploy API option. It will enable CORS to the selected Resource or Method.

note: I don't have enough reputation to embed the image in answer that's why the image link is provided.