Skip to content

Instantly share code, notes, and snippets.

@smokeymonkey
Created July 18, 2014 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smokeymonkey/76a5ca396d361dfc9075 to your computer and use it in GitHub Desktop.
Save smokeymonkey/76a5ca396d361dfc9075 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'uri'
uri = URI.parse(ARGV[0])
http = Net::HTTP.new(uri.host, uri.port)
http.set_debug_output $stderr
http.start{|http|
req = Net::HTTP::Get.new(uri.path + (uri.query.empty? ? "" : "?" + uri.query))
res = http.request(req)
puts res.body
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment