七牛革新接口php完成参考

<?php
require_once '../autoload.php';

use Qiniu\Auth;
use Qiniu\Http\Client;


$accessKey = 'accesskey';
$secretKey = 'secretkey';
$auth = new Auth($accessKey, $secretKey);

function fusion(Auth $auth, $method, array $data = array())
{
  var_dump(json_encode($data));
  $headers = $auth->authorization('http://fusion.qiniuapi.com/' . $method);
  $headers['Content-Type'] = 'application/json';
  $res = Client::post('http://fusion.qiniuapi.com/' . $method, json_encode($data), $headers);
  var_dump($headers);
  var_dump($res);
}

$urls = array(
              //'http://misc.rrcimg.com/dist/pc/js/search/search-a01198d1.js',
              'http://itisatest.qiniudn.com/aaa/bbb/sss',
);

$dirs = array(
              'http://itisatest.qiniudn.com/aaa/bbb/',
              'http://itisatest.qiniudn.com/ccc/ddd/',
);

$data = array(
              'urls' => $urls,
              //'dirs' => $dirs,
);

fusion($auth, 'v2/tune/refresh', $data);
    原文作者:三木
    原文地址: https://segmentfault.com/a/1190000006852464
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞