我在curl中完成了Paypal请求。但是,我想使用AngularJS发送此请求。如何在AngularJS中重写此请求?或者我可以在AngularJS请求中使用curl吗?如果是这样,怎么样?
curl -v https://api.sandbox.paypal.com/v1/payments/payouts?sync_mode=true \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d "{
"sender_batch_header": {
"email_subject": "You have a payment"
},
"items": [
{
"recipient_type": "EMAIL",
"amount": {
"value": 12.34,
"currency": "USD"
},
"receiver": "shirt-supplier-one@mail.com",
"note": "Payment for recent T-Shirt delivery",
"sender_item_id": "A123"
}
]
}"
这是我的jsfiddle.net/dv9v4t61/4
的链接