【发布时间】:2021-01-04 15:09:08
【问题描述】:
由于某种原因,我在向 FedEx 发送 API 的身份验证时收到 400 Bad Request 错误。
这是我的代码:
$payload = [
'grant_type' => 'client_credentials',
'client_id' => self::$apiKey,
'client_secret' => self::$apiSecret
];
$api = new App_ApiTransaction('POST', self::$authEndpoint, $payload, App_ApiTransaction::ENCODE_JSON);
$api->addHeader( 'Content-Type', 'application/x-www-form-urlencoded');
我尝试使用 GET,但收到 405 错误。另外,这是一个自定义的标头函数。
什么可能导致问题? 谢谢, 凯文
【问题讨论】:
标签: php rest restful-authentication fedex