Translate Ruby snippet to Java

Posted by sipwiz on Stack Overflow See other posts from Stack Overflow or by sipwiz
Published on 2010-03-17T03:52:38Z Indexed on 2010/03/17 4:01 UTC
Read the original article Hit count: 312

Filed under:
|

How can I do the equivalent of the Ruby snippet below using Java?

require 'net/http'
res = Net::HTTP.get_response(URI.parse("http://somewhere.com/isalive")).body

© Stack Overflow or respective owner

Related posts about ruby

Related posts about java