Skip to content

Instantly share code, notes, and snippets.

@shunwen
Created June 23, 2013 23:44
Show Gist options
  • Select an option

  • Save shunwen/5846964 to your computer and use it in GitHub Desktop.

Select an option

Save shunwen/5846964 to your computer and use it in GitHub Desktop.
How to visit an url in Ruby
# Not suitble for production
require 'open-uri'
open('http://github.com')
require 'net/http'
require 'uri'
uri = URI.parse "http://github.com/"
response = Net::HTTP.get_response uri
# Use system call
`curl http://github.com`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment