$url = "oauth/connect/token";
try {
$http = new \GuzzleHttp\Client;
$response = $http->post($url, ['form_params' => ['grant_type' => $grant_type, 'client_id' => $client_id, 'client_secret' => $client_secret,
'redirect_uri' => $redirect_uri, 'code' => $code],]);
} catch (\Exception $e) {
Log::info('curl_oauth/connect/token', ['msg' => $e->getMessage(), 'code' => $code, 'time' => date('Y-m-d H:i:s', time())]);
}
$total = json_decode((string)$response->getBody(), true);
//参数拼接
['form_params' => ['grant_type' => $grant_type, 'client_id' => $client_id, 'client_secret' => $client_secret,
'redirect_uri' => $redirect_uri, 'code' => $code],]
get和post类似