Home > Backend Development > PHP Tutorial > 使用新浪SDK.发布带图片的微博

使用新浪SDK.发布带图片的微博

WBOY
Release: 2016-06-23 14:26:23
Original
992 people have browsed it

这是发布的代码
 $params = array(
        'content' => '测试发表一条图片微博'
    );
$url = 'C:\\MyNews\\qq\\logo.png';//url
$img_name = basename($url);
$img_type = getimagesize($url);
    $multi =array("pic"=>array(
'type' => "image/jpeg",
'name' => "logo.png",
'data' => file_get_contents("C://MyNews/qq/logo.png")));
    $r = Tencent::api('t/add_pic', $params, 'POST', $multi);
    echo $r;
发布后,没有任何返回,已经开启调试模式!分不多,望谅解!
是图片的问题么?怎么改?


回复讨论(解决方案)

额 抱歉 头昏了,是腾讯的!

看代码貌似对腾讯api不是很理解啊,腾讯的sdk太垃圾了,完全就是临时工写的测试脚本,自己写一个api类吧,不超过300行代码,再写一个调用函数。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template