Ionic v1 错误仅在 POST 'Access-Control-Allow-Origin'
Ionic v1 error only in POST 'Access-Control-Allow-Origin'
我在使用 Ionic v1 进行 POST 调用时遇到错误。 GET 和 PUT 调用有效,但只有 POST 调用无效,错误是这样的:
XMLHttpRequest cannot load http://localhost:8080/FoodDrinkDispener/rest/user. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. The response had HTTP status code 403.
我在 "Postman" 中尝试了这个 POST 请求,效果很好。我不知道是什么问题是一个谜。我在互联网上找到了一些东西,但我读到在我的项目中不存在的一些配置文件中有一些东西需要更改(可能是 Ionic 版本)
使用 "Moesif Origin & CORS Changer" Google Chrome 扩展解决。
我在使用 Ionic v1 进行 POST 调用时遇到错误。 GET 和 PUT 调用有效,但只有 POST 调用无效,错误是这样的:
XMLHttpRequest cannot load http://localhost:8080/FoodDrinkDispener/rest/user. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. The response had HTTP status code 403.
我在 "Postman" 中尝试了这个 POST 请求,效果很好。我不知道是什么问题是一个谜。我在互联网上找到了一些东西,但我读到在我的项目中不存在的一些配置文件中有一些东西需要更改(可能是 Ionic 版本)
使用 "Moesif Origin & CORS Changer" Google Chrome 扩展解决。