# File lib/rubytter.rb, line 154 def http_request(host, req, param_str = nil) res = @connection.start(host) do |http| if param_str http.request(req, param_str) else http.request(req) end end json_data = JSON.parse(res.body) case res.code when "200" json_data else raise APIError.new(json_data['error'], res) end end