I've been looking for a proper way to close a HTTP connection and have found nothing yet.
uri = URI.parse("http://www.google.com")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new("/")
resp = http.request request
http.shutdown # error
http.close # error
the caller is responsible for closing it (the connection) upon completion