【发布时间】:2015-06-15 13:00:12
【问题描述】:
我正在尝试在本地构建一个通过 XMLHttpRequest/XCRF/JSON 连接到我的网站的 jQuery 移动应用程序。尝试连接到我的网站时出现以下错误:
XMLHttpRequest cannot load http://wwws.mydomain.com/rest/system/connect.
A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true.
Origin 'http://localhost' is therefore not allowed access.
我已根据 CORS 文档在我的网络服务器 (mydomain.com) 上启用了 CORS:
Header always set Access-Control-Allow-Origin "*"
如何从我的网站外部测试我的网络服务?当它转换为 Android 应用程序时,我会遇到类似的问题吗?
【问题讨论】:
标签: javascript android web-services