- Newest
- Most votes
- Most comments
Hi Jacob,
I can see you've set your Access-Control-Allow-Headers
configuration to *
which is not a valid value and this could be the reason why you're request is getting blocked. You can only use *
for Access-Control-Allow-Method
and Access-Control-Allow-Origin
, but not for Access-Control-Allow-Headers. You can check the AWS doco here https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html.
Try giving it a specific value, e.g., "Content-Type", etc. and hit your API Gateway again.
The reason why you're getting proper response using curl
is because your request is coming through as a server or API client call, rather than a browser-based call, hence the CORS is not being triggered. My understanding of the document is that CORS is triggered only when a client is a browser.
Regards, Ed
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 17 days ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Hi Ed,
Thanks for the suggestion! I updated the Access-Control-Allow-Headers as you suggested, but unfortunately I still get the same error.