Home >Backend Development >PHP Tutorial >Sina Weibo PHP version SDK causes 20007 error_PHP tutorial
This article is about reposting an article about the solution to the 20007 error caused by the Sina Weibo PHP version SDK. Friends who encounter such problems can refer to it.
Sina Weibo has an advanced interface ‘statuses/upload_url_text’ (requires additional application in open.weibo.com).
By passing an image URL address and text content, you can post a picture and text Weibo
The functions corresponding to the php version of SDK are as follows:
代码如下 | 复制代码 |
? /** * 指定一个图片URL地址抓取后上传并同时发布一条新微博 * * 对应API:{@link http://open.weibo.com/wiki/2/statuses/upload_url_text statuses/upload_url_text} * * @param string $status 要发布的微博文本内容,内容不超过140个汉字。 * @param string $url 图片的URL地址,必须以http开头。 * @return array */ function upload_url_text( $status, $url ) { $params = array(); $params['status'] = $status; $params['url'] = $url; return $this->oauth->post( 'statuses/upload', $params, true ); } |
There is an obvious error in calling the api: $this->oauth->post( 'statuses/upload', $params, true );
(On the one hand, it should request: statuses/upload_url_text, on the other hand, the third parameter is wrong)
As a result: 20007 error (20007: does multipart has image?)
It will be ok if you change it to this:
The code is as follows
|
Copy code | ||||
http: //www.bkjia.com/PHPjc/632141.html