我想用“照片 URL”更新 twitter 状态。
这是我的代码:
curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ci, CURLOPT_URL, 'https://upload.twitter.com/1/statuses/update_with_media.json');
curl_setopt($ci, CURLOPT_VERBOSE, FALSE);
curl_setopt($ci, CURLOPT_POSTFIELDS, array('media'=> '@http://sample.com/image.jpg', 'status'=>'This is a test image!'));
//'media' =>'@http://sample.com/image.jpg;type=image/jpeg;filename=image.jpg' doesn't work, too
$response = curl_exec($ci);
我也尝试使用apigee但不成功点击这里测试它!
PS:我不想使用 tmhOAuth 类!