Skip to content

Instantly share code, notes, and snippets.

@amundo
Created January 12, 2009 23:20
Show Gist options
  • Save amundo/46230 to your computer and use it in GitHub Desktop.
Save amundo/46230 to your computer and use it in GitHub Desktop.
require 'net/http'
Net::HTTP.start('en.wikipedia.org') do |http|
response = http.get('/wiki/Harry_Houdini', 'Accept' => 'text/xml')
#Do something with the response.
puts "Code: #{response.code}"
puts "Message: #{response.message}"
puts "Body:\n #{response.body}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment