Hi,
I have this [PayPal] example of cURL:
curl https://api.sandbox.paypal.com/v1/oauth2/token \ -H "Accept: application/json" \ -H "Accept-Language: en_US" \ -u "EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp:EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp" \ -d "grant_type=client_credentials"
I want to use postUrl and did the following:
- headersMap = map();
- headersMap.put("Accept-Language", "en_US");
- headersMap.put("Accept", "application/json");
- detailsString = "grant_type=client_credentials";
- responseMap = postUrl("https://EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp:EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp@api.sandbox.paypal.com/v1/oauth2/token", detailsString, headersMap,false);
- alert(responseMap);
and other variations that all fail with as similar to this:
{"responseCode":"415","responseText":"HTTP Error"}
Any help is blessed :)
Cheers,