腾讯云图床api php

2020-05-08 17:43:19 浏览数 (1)

代码语言:txt复制
git地址:https://github.com/PandaFlyer
代码语言:txt复制
<?php
$file = './test.jpg'; // 设置为你的图片路径 ,可根据此代码修改修改api
$ch = curl_init();
curl_setopt($ch,CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL,'https://img.yuanmabao.com/zijie/pic/2020/05/08/x5znvw20bqm',
        'type' => 'image/jpeg',
        'lastModifiedDate' => 'Sat Dec 28 2019 22:31:17 GMT 0800 (中国标准时间)',
        'appkey' => '1',
        'isRetImgAttr' => '1',
        'from' => 'user'
    ]);
if(curl_exec($ch) === false){
        echo 'Curl error: ' . curl_error($ch);
}
$result = curl_exec($ch);
curl_close($ch);
print_r($result)
?>
代码语言:txt复制
//返回数据
{
    "response": {
        "code": 0,
        "msg": "success!"
    },
    "data": {
        "url": {
            "type": 2,
            "width": 2047,
            "height": 1424,
            "length": 254943,
            "isqrcode": 0,
            "url": "http://inews.gtimg.com/newsapp_ls/0/11716162578/0"
        }
    }
}

0 人点赞