0
目前我正在使用paypal API並與此文檔make your first call一起流動。PayPal API with angular and cURL
當我通過角度$ http發送一個請求到貝寶,我得到了一個狀態碼415.這似乎是我錯過了什麼,有沒有人可以幫助我? :)
here is my code
$http({
url: 'https://api.sandbox.paypal.com/v1/oauth2/token',
method: 'POST',
headers: {'Content-Type': 'application/json',
'auth-token': 'EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp',
'Accept-Language': 'en_US'
},
data: { 'grant_type': 'client_credentials' }
}).success(function (data, status, headers, config) {
console.log(data)
}).error(function (data, status, headers, config) {
console.log(data)
});
感謝Rebornixm,它的作品! – Aiden 2015-02-07 14:26:49
太棒了!你可能想接受我的答案爲正確:) – Rebornix 2015-02-07 14:27:46
嗨,Rebornixm,我遇到了一個新問題。你能再次幫助我嗎,非常感謝。 :) [新問題](http://stackoverflow.com/questions/28384174/paypal-api-with-angular-400-bad-request) – Aiden 2015-02-07 15:57:04