That was a fun one :)

This should work for you.
var encoder:Base64Encoder = new Base64Encoder(); encoder.insertNewLines = 
false; encoder.encode(client_id + ":" + secret);
var s:String = encoder.toString();
var paramss:URLVariables = new URLVariables(); 
paramss.grant_type='client_credentials'
var headers:Array = [ new URLRequestHeader("contentType", 
"application/x-www-form-urlencoded"), new URLRequestHeader("Accept-Language", 
"en_US"), new URLRequestHeader("Authorization", "Basic " + s)];
var urlReq:URLRequest = new 
URLRequest('https://api.sandbox.paypal.com/v1/oauth2/token') urlReq.method = 
URLRequestMethod.POST; urlReq.data = paramss; urlReq.requestHeaders = headers;
var urlLoader:URLLoader = new URLLoader(urlReq); 
urlLoader.addEventListener(Event.COMPLETE, onLoadCompleteAgain); 
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError); 
urlLoader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, 
onHTTPResponse); urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, 
onHTTPStatus); urlLoader.load(urlReq); 

    On Friday, April 1, 2016 3:16 PM, OmPrakash Muppirala 
<[email protected]> wrote:
 

 Looks like it is a well documented issue:
http://blogs.adobe.com/koestler/2010/12/dealing-with-argumenterrors-while-pushing-urlrequestheaders.html

Have you tried to do a search and replace for new line on the encoder
string?

Thanks,
Om

On Fri, Apr 1, 2016 at 11:41 AM, leokan23 <[email protected]> wrote:

> Hi Matthew,
>
> thanks for the notice :) i have been looking at this for a while. The app
> will be used to buy physical goods which will be shipped to the users
> address and this is why i am looking at PayPal.
>
> Thanks for the info though.
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/PayPal-integration-Error-2096-tp12359p12390.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>


   

Reply via email to