AWS API Gateway - CORS + POST not working

前端 未结 9 1811
一生所求
一生所求 2020-12-01 10:34

CORS is really driving me crazy and I\'m really out of ideas as of what to try to make it work.

I have created a simple APIG Api with 1 resource cal

9条回答
  •  死守一世寂寞
    2020-12-01 11:02

    There have been many posts that direct you to make sure the lambda function is returning the appropriate CORS headers, and they are correct. However, it is also critical that the json object is stringified using JSON.stringify(). It seems that Postman does this for us, so it is misleading when the Postman request and the $.ajax request send the same json object; yet one succeeds and one fails.

提交回复
热议问题