Get url and response : HTTP Reponse « Network « Ruby
- Ruby
- Network
- HTTP Reponse
Get url and response
require 'uri'
Net::HTTP.get(URI.parse("http://www.oreilly.com"))
response = Net::HTTP.get_response('www.oreilly.com', '/about/')
puts "Success!" if response.is_a? Net::HTTPOK
# Success!
Related examples in the same category