0

I want to make a GET and POST request from my client to Mocky IO.

Here is my code:

function getData() {
        return $http.get('http://www.mocky.io/v2/5185415ba171ea3a00704eed');
    }

I am getting following error:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

How can this be resolved?

Kreena Mehta
  • 303
  • 1
  • 5
  • 16
  • This may help: https://stackoverflow.com/questions/247483/http-get-request-in-javascript –  Jul 15 '17 at 20:40
  • This is an issue with mocky.io's API, not your code. They need to include CORS headers if they want people to be able to use their API. – lleaff Jul 15 '17 at 20:40

0 Answers0