Skip to content

Instantly share code, notes, and snippets.

@nuke99
Created June 11, 2012 20:45
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 nuke99/2912574 to your computer and use it in GitHub Desktop.
Save nuke99/2912574 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'net/http'
def req_get(url)
uri = URI(url)
#puts uri
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri.request_uri
response = http.request request # Net::HTTPResponse object
# puts response.body
# puts "--------------------------------"
return response
end
end
q = req_get("http://bitbucket.com")
puts q.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment