http Post with parameters

14 views
Skip to first unread message

siva

unread,
Feb 15, 2018, 8:46:56 AM2/15/18
to Angular and AngularJS discussion
Hi,

While using http post for cross domain
     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': '333333',
                        '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. 

Please suggest on it.

Sander Elias

unread,
Feb 15, 2018, 9:32:37 AM2/15/18
to Angular and AngularJS discussion
Hi Siva,

Solve the CORS issue on your server. 

Regards
Sander
Reply all
Reply to author
Forward
0 new messages