这是我的全code ...否“访问控制允许来源”标头在办理Ionic2 HTTP POST请求
this.http.post(link, data, { headers: headers })
.map(res => res.json())
.subscribe(data => {
this.data.response = data._body;
}, error => {
console.log("Oooops!");
});
运行代码后,这个错误存在:
"XMLHttpRequest cannot load
https://script.google.com/macros/s/AKfycbzdHHKBmLWJYZtFGlJGOrUwlPIWXor1geEOgcSgvhs/dev.
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 401."
我搜索关于CORS ...但我不能让我的头周围...
任何帮助将不胜感激。
Duplicate:http://stackoverflow.com/questions/30132885/ionic-app-cannot-connect-cors-enabled-server-with-http – Quentin
相关:http://stackoverflow.com/questions/35553500/xmlhttprequest -cannot-load-https-www-website-com/ – Quentin
你正在发送你的POST请求的链接没有来自服务器的访问权限来访问它请求的任何信息......它是客户端到位的安全机制服务器通信 – repzero