def response_of_uri(uri)
      begin
        Net::HTTP.start(uri.host, uri.port) do |http|
          http.head(uri.path.size > 0 ? uri.path : "/").code
        end
      rescue Exception => e
        "Error"
      end
    end
def response_of_uri(uri)
      begin
        Net::HTTP.start(uri.host, uri.port) do |http|
          http.head(uri.path.size > 0 ? uri.path : "/").code
        end
      rescue Exception => e
        "Error"
      end
    end
Checks whether the uri is reachable. If so it returns '200' otherwise
 'Error'. uri has to have a host, that is uri.host should not be nil