No 'Access-Control-Allow-Origin' header is present on the requested resource- AngularJS

前端 未结 12 1084
有刺的猬
有刺的猬 2020-11-27 03:18
XMLHttpRequest cannot load http://mywebservice. No \'Access-Control-Allow-Origin\' header is present on the requested resource. Origin \'http://localhost:9000\' is t         


        
12条回答
  •  有刺的猬
    2020-11-27 04:10

    It is a problem on the server side. You have to add your client address to your server exposed API. If you are using Spring frame work you can annotate @CrossOrgin from org.springframework.web.bind.annotation.CrossOrigin;

    Eg : @CrossOrigin(origins = "http://localhost:8080")

提交回复
热议问题