Reddit访问令牌检索失败

时间:2019-10-24 09:26:29

标签: php reddit

我无法使用此端点获取访问令牌。 https://www.reddit.com/api/v1/access_token

我的代码是:

$curl = curl_init('https://www.reddit.com/api/v1/access_token');

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, array(
    'grant_type' => 'authorization_code',
    'code' => $authentication_code,
    'redirect_uri' => $redirect_uri
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

echo $auth = curl_exec($curl);

有人可以帮助我吗?

0 个答案:

没有答案