【发布时间】:2016-06-02 00:31:45
【问题描述】:
我正在使用 Ionic 框架,我正在尝试在我的 Ionic 框架中使用 $http 服务访问 Restful API,我在控制台中收到以下错误。
XMLHttpRequest cannot load https://apiexample.com/token/ Response to preflight request doesn't pass access control check: 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 405.
有人知道如何使用 $http 服务从我的 Angular Js 访问 Rest 完整 API 吗?
任何帮助将不胜感激,在此先感谢:D
【问题讨论】:
标签: angularjs ionic-framework xmlhttprequest