Search code examples
javascriptangularjshttpjsonptwitter-oauth

calling JSONP with headers from angularjs


    $http({
      method: 'JSONP',
      url: 'https://api.twitter.com/1.1/friends/list.json?screen_name=%40name',
      headers: {
        Authorization: 'bearer AAAAAAAAAAAAAAAAAXXXXXXXXXXXXXXXXXXXXXXXXNxXXXXXXXXXXXX'
      }
    }).then(function (data) {
         console.log(data);
       });

I am trying to get my followers list from twitter.whats wrong with my code?

thanks for all help.


Solution

  • JSONP can not be called with headers.We must use GET to pass headers.