Using Paypal REST with Classic ASP

2

I'm trying to make a simple call to the Paypal API with the following code:

On error resume next

Set objHTTP = CreateObject("Microsoft.XMLHTTP")
objHTTP.open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False

objHTTP.setRequestHeader "Accept", "application/json"
objHTTP.setRequestHeader "Accept-Language", "en_US"
objHTTP.setRequestHeader "Authorization", "Basic " & Base64Encode("client-id:secret")
objHTTP.send "grant_type=client_credentials"

Response.Write err.description & " | " & err.number

But you're returning the error:

The download of the specified resource has failed

With Postman it works without problems. Would anyone know where the error is? I am using on localhost without SSL (I do not know if this affects).

    
asked by anonymous 19.07.2016 / 22:33

0 answers