Skip to content

Instantly share code, notes, and snippets.

@mkristian
Created November 7, 2012 07:40
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 mkristian/4030050 to your computer and use it in GitHub Desktop.
Save mkristian/4030050 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'net/https'
require 'uri'
uri = URI.parse('https://www.google.com/index.html')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == "https" # enable SSL/TLS
http.start {
http.request_get(uri.path) {|res|
print res.body
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment