Skip to content

Instantly share code, notes, and snippets.

@taise
Created March 15, 2013 04:58
Show Gist options
  • Select an option

  • Save taise/5167595 to your computer and use it in GitHub Desktop.

Select an option

Save taise/5167595 to your computer and use it in GitHub Desktop.
Net::HTTP::Get sample
require 'net/http'
query_ary = ['/accounts', '/information', '/requests', '/pays', '/changes']
http = Net::HTTP.new('localhost', 3000)
query_ary.each do |query|
req = Net::HTTP::Get.new(query + '/1.json')
res = http.request(req)
puts "\n##{query} ==========================="
puts res.body.split(',')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment