Php Yii Curl包装器集授权头
我在Yii中使用了这个卷发包装器: 我正在尝试使用以下代码发送标头中的授权承载令牌:Php Yii Curl包装器集授权头,php,curl,yii,authorization,token,Php,Curl,Yii,Authorization,Token,我在Yii中使用了这个卷发包装器: 我正在尝试使用以下代码发送标头中的授权承载令牌: $auth = array("Authorization: Bearer".$token); // I am tried this too //$auth = array("Authorization" => "Bearer".$token); $jsonObject = Yii::app()->curl->setOption(CURLOPT_HTTPHEADER, $auth)->ge
$auth = array("Authorization: Bearer".$token);
// I am tried this too
//$auth = array("Authorization" => "Bearer".$token);
$jsonObject = Yii::app()->curl->setOption(CURLOPT_HTTPHEADER, $auth)->get($url);
但我得到了同样的错误结果,错误是:
Undefined index: scheme
Error in Curl.php line 93 <- that wrapper
未定义索引:方案
Curl.php第93行出错我已经检查了hackernon Curl中的代码。我认为问题在于$url
值没有类似http://
的模式
$url = 'http://www.google.com' // good
$url = 'www.google.com' // bad