php如何触发持久化处理?

代码如下,可最后还是提示{"error":"bad token"}

require_once('qiniu/rs.php');
require_once('qiniu/http.php');
require_once('qiniu/auth_digest.php');
require_once('qiniu/utils.php');

$accessKey = '<access key>';
$secretKey = '<secret key>';
Qiniu_SetKeys($accessKey, $secretKey);
$mac = new Qiniu_Mac($accessKey, $secretKey);

$query = "bucket=mybucketname&key=news1015.wmv&fops=fop1&notifyURL=http://www.mywebsite.com/";
$sign_data = "/pfop/\n" . $query;
$accessToken = $mac->Sign($sign_data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.qiniu.com/pfop/');
$header[] = "Content-Type: application/x-www-form-urlencoded";
$header[] = "Authorization: QBox ".$accessToken;
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$output=curl_exec($ch);
阅读 4.2k
2 个回答