![](/img/trans.png)
[英]how can I capture response from twitter.com? ( ruby + twitter gem)
[英]how can I capture **http response** from twitter.com? ( ruby + twitter gem)
我提出了一个问题, 如何捕捉来自twitter.com的回复? (ruby + twitter gem)了解我的更新是否成功。 工作正常...
但是我想知道如何在ruby代码中捕获HTTP响应代码和错误 ?
oauth = Twitter::OAuth.new('consumer token', 'consumer secret')
oauth.authorize_from_access('access token', 'access secret')
client = Twitter::Base.new(oauth)
response = client.update('Heeeyyyyoooo from Twitter Gem!')
如果您在安装了firebug插件的情况下使用firefox,它将在“ NET”选项卡上显示http响应代码。
还是您需要在应用程序中执行此操作?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.