public
Last active

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9
require "rest-client"
 
begin
exists = RestClient.head("http://google.com").code == 200
rescue RestClient::Exception => error
exists = (error.http_code != 404)
end
 
puts "exists=#{exists}"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.