【发布时间】:2015-12-30 06:17:51
【问题描述】:
我正在尝试通过 abraham 的 twitteroauth 库的 statuses/update_with_media twitter api 发布多张图片。 我发布的是单张图片,而不是多张图片。
My code is like below:
$params = array('media[]' => file_get_contents($image_url),
'status' => $message
);
$connection->post('statuses/update_with_media',$params,true);
Where $connection is a object of TwitterOAuth.
Function of TwitterOAuth library is below:
function post($url, $parameters = array(), $multipart = false) {
$response = $this->oAuthRequest($url, 'POST', $parameters, $multipart);
if ($this->format === 'json' && $this->decode_json) {
return json_decode($response);
}
return $response;
}
我知道我必须对 media[] 进行一些更改。但我无法获得正确的输出。 所以请给我建议。
提前致谢 哈里·沙阿
【问题讨论】:
标签: twitter twitter-oauth