Quantcast
Channel: Adobe Community : Unanswered Discussions - AIR Development
Viewing all articles
Browse latest Browse all 2010

Error #2096: The HTTP request header

$
0
0

So i am trying to integrate PayPal in my Flex Mobile app. I make my first call like this:

 

(keys are sandbox by paypal dev resources)

 

protected function getPaypal():void {

  var client_id:String="EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp";

  var secret:String="EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp";

 

  var params:Object = new Object();

  params.grant_type="client_credentials";

 

  var encoder:Base64Encoder = new Base64Encoder();

  encoder.encode(client_id + ":" + secret);

 

  //var s:String = JSON.stringify(params);

  paypal.contentType = "application/x-www-form-urlencoded";

  paypal.headers["Authorization"] = "Basic " + encoder.toString();

  paypal.method = "POST";

  paypal.url = "https://api.sandbox.paypal.com/v1/oauth2/token";

  paypal.send(params);

  }

 

This fails and returns the following:

'Error #2096: The HTTP request header Basic RU9KMlMtWjZPb05fbGVfS1MxZDc1d3NaNnkwU0ZkVnNZOTE4M0l2eEZ5WnA6RUNsdXNNRVVrOGU5

aWhJN1pkVkxGNWNaNnkwU0ZkVnNZOTE4M0l2eEZ5WnA= cannot be set via ActionScript.' faultDetail:'null'

 

I can't figure out what seems to be the problem.

 

Any help?


Viewing all articles
Browse latest Browse all 2010

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>