AWS API Gateway endpoint gives CORS error when POST from static site on S3

前端 未结 9 2391
予麋鹿
予麋鹿 2020-12-16 13:45

I have created an API endpoint with Serverless(serverless.com) which I expose through API Gateway. I\'m getting following error though I have enabled CORS from the

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-16 14:02

    Response should have, If you are using AWS lamda, set response headers as follows. Configuration on API Gateway only will not work

    headers: {
                'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*',
            },
    

提交回复
热议问题