2

Twitterのステータスを「写真URL」で更新したい。

これが私のコードです:

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 クラスは使いたくない!

4

1 に答える 1