针对Twitter的REST方法面临错误

时间:2011-08-01 17:20:31

标签: ruby-on-rails rest twitter restful-authentication omniauth

每当我做GET时

http://api.twitter.com/1/friends/UID.json
http://api.twitter.com/1/followers/?ids%5B%5D=74776862

https://api.twitter.com/1/statuses/user_timeline.json

我收到此错误

{"error":"This method requires authentication.","request":"\/1\/statuses\/user_timeline.json"}

和响应为

"<html><body>You are being <a href=\"http://api.twitter.com/login?redirect_after_login=%2F1%2Ffollowers%2F%3Fids%255B%255D%3D74776862\">redirected</a>.</body></html>"

我也应该通过其他事吗?

1 个答案:

答案 0 :(得分:1)

查看Twitter documentation。您有几种身份验证选项。对于RESTful服务OAuth是可行的方法。