我正在尝试使用Rest api在Paypal的保管库中保存卡
我将Curl转换为Kotlin代码
curl -v -X POST https://api.sandbox.paypal.com/v1/vault/credit-cards/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
"number": "4417119669820331",
"type": "visa",
"expire_month": "11",
"expire_year": "2015",
"first_name": "Joe",
"last_name": "Shopper",
"billing_address": {
"line1": "52 N Main St.",
"city": "Johnstown",
"country_code": "US",
"postal_code": "43210",
"state": "OH",
"phone": "408-334-8890"
}
}'
这是我使用的代码
@POST(AppConstants.SAVE_CARD)
@Headers("Content-Type: application/json")
fun saveCard(
@Header("Authorization") token: String,
@Body creditCard: CreditCard
): Call<CreditCardResponse>
但是作为响应,我得到了一个空的正文,并且其中没有错误正文。 任何人都可以发现问题所在吗?