不确定我做错了什么,但在尝试从信息中心获取帖子时,我一直收到=> #<Net::HTTPOK 200 OK readbody=true>
。
consumer = OAuth::Consumer.new( key, secret, {
:site => "http://www.tumblr.com",
:scheme => :header,
:http_method => :post,
:request_token_path => "/oauth/request_token",
:access_token_path => "/oauth/access_token",
:authorize_path => "/oauth/authorize"
})
request_token = consumer.get_request_token
# pasting this in url and getting oauth_verifier
# request_token.authorize_url
access_token = request_token.get_access_token({:oauth_verifier =>
params[:oauth_verifier]})
puts access_token.get('api.tumblr.com/v2/user/dashboard')
答案 0 :(得分:1)
已更改response = access_token.get('http://api.tumblr.com/v2/user/dashboard')
,然后JSON.parse(response.body)
正常工作。