【发布时间】:2020-10-15 11:04:16
【问题描述】:
我正在尝试在 api 沙箱中进行身份验证,但错误 400 正在返回给我,我已经通过扩展获得了它,但是在带有 guzzle 的代码中它不起作用,我需要传递带有加密授权的 Header 参数,因为它是.
$client = new \GuzzleHttp\Client(['headers' => ['Authorization' => 'Basic $token']]);
$response = $client->post('', [
'grant_type' => 'password',
'scope' => 'forintegration',
'username' => '',
'password' => '',
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
【问题讨论】: