gpt4 book ai didi

aws-lambda - API 网关 : Can't Enable CORS

转载 作者:行者123 更新时间:2023-12-04 17:32:42 25 4
gpt4 key购买 nike

我无法在我的 API Gateway 实例上启用 CORS,它是这样的:

1.设置:
enter image description here

2. 结果:
enter image description here

我尝试了很多方法,例如检查 DEFAULT 4XXDEFAULT 5XX并按照某些帖子中的建议手动输入 Access-Control-Allow-Methods。

如果我将鼠标悬停在错误上,我会得到:Invalid Response status code specified .

我可以使用浏览器进行 GET,但 POST 只能通过 Postman 完成。我的 ReactJS 网站也不会发布,抛出:
Access to XMLHttpRequest at <ENDPOINT> from origin <S3-REACT-BUCKET> has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
我读过我的 React 应用程序应该发送 CORS header (还没有达到),但我什至无法在 API 网关中启用 CORS!

最佳答案


那是因为没有方法响应

关于aws-lambda - API 网关 : Can't Enable CORS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58036272/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com