title: Translate Ruby snippet to Java
body: <p>How can I do the equivalent of the Ruby snippet below using Java?</p>
  
  <pre><code>require 'net/http'
  res = Net::HTTP.get_response(URI.parse("http://somewhere.com/isalive")).body
  </code></pre>