代码
$response = $this->http->request('post', 'http://ruicao.io/api/oauth/token', [
'form_params' => [
'username' => '[email protected]',
'password' => '123456',
'client_id ' => '1',
'client_secret' => 'PXrLBReX7gPjheLcfXJzF223GnI1uDHv8xw3SsZB',
'grant_type' => 'password',
'scope' => '',
]
]);
报错信息
Client error: `POST http://ruicao.io/api/oauth/token` resulted in a `400 Bad Request` response:\n
{"error":"invalid_request","message":"The request is missing a required parameter, includes an invalid parameter value, (truncated...)\n
提示缺少参数,已经将值都写在 form_params
里了