【发布时间】:2017-04-28 01:04:07
【问题描述】:
我创建了 asp.net webApi 并在 somee.com 上发布。我输入链接 xxxx.somee.com/api/xxxx 就可以了。但是我调用 Angularjs 不运行
$http.get('http://xxxxxx.somee.com/api')
.then(function(response) {
console.log(response);
});
我收到错误:
XMLHttpRequest 无法加载 xxxx.somee.com/api/xxxx。请求的资源上不存在“Access-Control-Allow-Origin”标头。因此不允许访问 Origin 'null'。
请给出解决方案。非常感谢。
【问题讨论】:
-
请在询问之前尝试搜索该特定错误。在这个网站和整个网络上有成千上万个关于它的问题
标签: javascript angularjs asp.net-web-api