0

I have a URL. Lets call it www.x.com. When i hit this URL from the browser, the browser automatically downloads a .json file. This file has the response I need. The download is triggered automatically as soon as you paste the url on the browser and hit enter.

Now, I am trying to open this URL from javascript (angular) using $http.get(URL). I am not able to get the response. I am missing some headers, I guess. But I'd really appreciate it if someone mentions the headers.

  • Sounds like a CORS issue: https://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work – Alex K Nov 17 '17 at 19:04
  • I agree with Alex. Make sure you're console logging out both the error and response and I bet you'll see a CORS log. – austinthedeveloper Nov 17 '17 at 21:49

0 Answers0