当我打电话给 Soap ui服务时没有标题,它的工作和服务器返回json:
return this.http.get(url)
.map(res => res.json());
但是当我添加标题时:
var headers = new Headers();
headers.append('Content-Type', 'application/json');
return this.http.get(url,{headers: headers})
.map(res => res.json());
浏览器返回cors错误:
XMLHttpRequest cannot load http://desktop-0n2fu3g:8089/RechercherClients. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 404.
是否有任何解决方案可以使其发挥作用?