Issues with cross domain

已查看 16 次
跳至第一个未读帖子

siva

未读,
2018年2月15日 08:46:562018/2/15
收件人 Angular and AngularJS discussion
Hi,

I tried like the below

  var config = {
                    headers: {
                        'contentType': 'application/x-www-form-urlencoded; charset=utf-8',
                        'Access-Control-Allow-Origin': '*',
                        'Access-Control-Allow-Methods': 'POST',
                        'response_type': '"code"',
                        'redirect_uri': '"myurl.com"',
                        'client_id': 'xxxxx',
                        'state': '22222',
                        'scope': 'r_basicprofile'
                    }
                }

                $http.post('https://www.linkedin.com/oauth/v2/authorization', config).then(function (response) {
                    $scope.result = response.data;
                }, function (response) {

   });

i am getting the below error

 Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.Origin myrul.com  is therefore not allowed access. The response had HTTP status code 404.

Please suggest on this.

回复全部
回复作者
转发
0 个新帖子