试图收藏推文/状态

时间:2012-09-13 01:01:39

标签: php api twitter

使用$ connection = new tmhOAuth(array(....)建立连接 已成功以这种方式发推文..

所以,我试图喜欢推文/状态,如下:

$the_tweet = 239128150125191168;

$connection->request('POST', $connection->url('1/favorites/create'), array('id' => $the_tweet));

它给了我一个400错误代码。无法弄清楚为什么。如果我使用GET,我得到200,但它不喜欢推文。它必须是一个POST,这就是定义所说的。

非常感谢任何帮助。

谢谢, 埃迪

1 个答案:

答案 0 :(得分:0)

如果你这样做,我希望它可以工作:

$connection->request('POST', $connection->url('1/favorites/create/'.$the_tweet.'.json') );

如果你注意到这里:https://dev.twitter.com/docs/api/1/post/favorites/create/%3Aid “POSTDATA”没有。

相关问题