Skip to content

Instantly share code, notes, and snippets.

@phil
Created June 11, 2014 12:46
Show Gist options
  • Save phil/b88b65f6a590f2e31d6f to your computer and use it in GitHub Desktop.
Save phil/b88b65f6a590f2e31d6f to your computer and use it in GitHub Desktop.
Ruby Core Library HTTP Response example
require 'net/http'
(1..20).each do |i|
response = Net::HTTP.get_response(URI("http://kyan.com"))
puts "#{i}: #{response.code}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment