PayPal API V2 创建发票错误 Response/Status 代码
PayPal API V2 Create Invoice Wrong Response/Status Code
我在使用 PayPal API V2 创建发票时收到错误的 response/status 代码。我得到的状态代码是 200 而不是 201,它会产生以下响应。根据文档应该返回一个 Created 状态代码 201 和一个显示发票详细信息的 JSON 响应正文
"rel" => "self"
"href" => "https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-2LMY-9VSE-KKRR-RGYP"
"method" => "GET"
200 和 201 基本上可以互换。 documentation 状态:
A successful request returns the HTTP 200 OK status code and a JSON
response body that shows template details if you set
prefer=return=representation.
HTTP header 字符串的格式应该是 Prefer: return=representation
默认为return=minimal
,它只会包含GET link.
我在使用 PayPal API V2 创建发票时收到错误的 response/status 代码。我得到的状态代码是 200 而不是 201,它会产生以下响应。根据文档应该返回一个 Created 状态代码 201 和一个显示发票详细信息的 JSON 响应正文
"rel" => "self"
"href" => "https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-2LMY-9VSE-KKRR-RGYP"
"method" => "GET"
200 和 201 基本上可以互换。 documentation 状态:
A successful request returns the HTTP 200 OK status code and a JSON response body that shows template details if you set prefer=return=representation.
HTTP header 字符串的格式应该是 Prefer: return=representation
默认为return=minimal
,它只会包含GET link.