调用API函数“auth / token / from_oauth1”时出错:错误的HTTP“Content-Type”标题:“application

时间:2018-06-11 10:12:44

标签: laravel curl dropbox-api dropbox-php dropbox-sdk

我正在调用app auth api但我收到以下错误。

调用API函数“auth / token / from_oauth1”时出错:错误的HTTP“Content-Type”标题:“application / json; boundary = ----------------- ------- 796cea680fa095ca”。期待“application / json”之一,“application / json; charset = utf-8”,“text / plain; charset = dropbox-cors-hack”。

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.dropboxapi.com/2/auth/token/from_oauth1");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Authorization: Basic bmF0dWdweTsdwqegzbnE1MDFs4OnFiN3F3an3p3anpkdGJzOA=='
));
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
    'oauth1_token' => 'natugpy83123nq5sdf01l',
    'oauth1_token_secret' => 'qb7qwjsdfzwjzdtfbs8',
));
$result = curl_exec($ch);
curl_close($ch);

0 个答案:

没有答案