Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs Nike No';访问控制允许原点';请求的资源上存在标头_Angularjs_Http_Nike - Fatal编程技术网

Angularjs Nike No';访问控制允许原点';请求的资源上存在标头

Angularjs Nike No';访问控制允许原点';请求的资源上存在标头,angularjs,http,nike,Angularjs,Http,Nike,我正在尝试使用Angulars$http请求从Nike商店网站获取当前的男士清关鞋,并将其显示在我自己的网站上 $http({ method: 'GET', url: 'http://store.nike.com/html-services/gridwallData?country=US&lang_locale=en_US&gridwallPath=mens-clearance-shoes/' }).then(function succe

我正在尝试使用Angulars$http请求从Nike商店网站获取当前的男士清关鞋,并将其显示在我自己的网站上

 $http({
        method: 'GET',
        url: 'http://store.nike.com/html-services/gridwallData?country=US&lang_locale=en_US&gridwallPath=mens-clearance-shoes/'
    }).then(function successCallback(response) {
        console.log('success',response);
    }, function errorCallback(response) {
        console.log('error',response);
    }); 
然而,它给了我这个错误

XMLHttpRequest cannot load http://store.nike.com/html-services/gridwallData?country=US&lang_locale=en_US&gridwallPath=mens-clearance-shoes/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.
我知道这是一个跨来源的资源共享问题。有没有办法绕过这个?我还可以合法地在我的网站上展示他们的清关产品吗?

添加此项

   myApp.config(['$httpProvider', function($httpProvider) {
            $httpProvider.defaults.useXDomain = true;
            delete $httpProvider.defaults.headers.common['X-Requested-With'];
        }
    ]);

“我还能合法地在我的网站上展示他们的清关产品吗?”我们无法回答。“有没有办法绕过这一点”是的,与许多其他关于绕过CORS限制的相同问题中描述的方法相同。为什么不?他们的api是公开的,我可以在自己的网站上使用吗?我应该在stacklaw中问一下吗?因为我们不是律师,我们不能给你法律建议(如果我们这样做了,你就不应该相信它)。。他们通常也不是法律工作者。如果他们的web服务支持,您可以使用来解决跨源问题。您正在运行哪台服务器?抱歉,没有看到。我正在运行一个节点服务器。我可以使用jqueryajax调用来获取数据。