This works great:
require 'net/http'
uri = URI('http://api.twitter.com/1/statuses/user_timeline.json')
args = {include_entities: 0, include_rts: 0, screen_name: 'johndoe', count: 2, trim_user: 1}
uri.query = URI.encode_www_form(args)
resp = Net::HTTP.get_response(uri)
puts resp.body
But changing from http
to https
leads to a meaningless error. I'm not asking why the error is meaningless, I would just like to know what's the closest means of doing get_response
for https
?
I've seen the 'HTTPS' example in the Net::HTTP doc but it looks not very impressive and will make me manually compose the URL from my parameters hash - no good.