http://www.w2bc.com/article/142368
正确的获取access_token的方式
策略:GET和POST混合:用GET去传递参数,CURL(POST)来返回access_token。
$data = array("" => '');
$data = http_build_query($data);
$opts2 = array(
'http'=>array(
'method'=>"POST",
'header'=>"Content-type: application/x-www-form-urlencoded\r\n".
"Content-length:".strlen($data)."\r\n" .
"Cookie: foo=bar\r\n" .
"\r\n",
'content' => $data,
)
);
$cxContext = stream_context_create($opts2);
$data = file_get_contents($opts_sina, false, $cxContext);