I have an API gateway endpoint (https://mhw8mm294k.execute-api.us-east-1.amazonaws.com/prod/saveImage). It integrates with a lambda function. There are three methods (GET,POST,OPTIONS). CORS is enabled in the gateway and the lambda returns the necessary headers.
The GET method was only created for CORS testing. It works. However when it is posted I get a CORS error. This seems impossible. CORS is enabled in the API gateway at the resource level.
The error is :
Access to XMLHttpRequest at 'https://mhw8mm294k.execute-api.us-east-1.amazonaws.com/prod/saveImage' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
The general info is:
Request URL:https://mhw8mm294k.execute-api.us-east-1.amazonaws.com/prod/saveImageRequest Method:POSTStatus Code:400 Bad RequestReferrer Policy:strict-origin-when-cross-origin
The request header:
Request URL:https://mhw8mm294k.execute-api.us-east-1.amazonaws.com/prod/saveImageRequest Method:POSTStatus Code:400 Bad RequestReferrer Policy:strict-origin-when-cross-origin
Postman works... But the code (axios) doesn't.
Any ideas?? Thanks in advance.