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.1k
2 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进