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

前端 未结 12 1507
有刺的猬
有刺的猬 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:16

    I got

    No 'Access-Control-Allow-Origin' header is present

    and the problem was with the URL I was providing. I was providing the URL without a route, e.g., https://misty-valley-1234.herokuapp.com/.

    When I added a path it worked, e.g., https://misty-valley-1234.herokuapp.com/messages. With GET requests it worked either way but with POST responses it only worked with the added path.

提交回复
热议问题