I'm trying to do a quite simple task - getting the html content of a website with AngularJS. This is my code:
$http({method: 'GET', url: "http://www.google.com",
headers:{
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, X-Requested-With'
}})
.success(function(d){ console.log( "yay" ); })
.error(function(d){ console.log( "nope" ); });
The problem is that I get the CORS error:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
I familiar with the CORS issue quite well, I know it's a server issue mainly. But still, can anyone suggest (if possible) a solution to my problem?