What's the easiest way to get the result of an HTTP GET request in using URL in JRuby

Posted by sipwiz on Stack Overflow See other posts from Stack Overflow or by sipwiz
Published on 2010-03-17T00:33:56Z Indexed on 2010/03/17 1:21 UTC
Read the original article Hit count: 424

Filed under:
|
|

I'm attempting to build a Tropo Ruby application and I need to retrieve the result of an HTTPS GET. The Tropo platform doesn't have the httpclient Ruby gem so I can't use that. The Ruby engine used is JRuby so a suggestion has been to make use of the Java URL class to do the request. I've played around with it a little bit and I seem to be able to create the URL object ok but am now struggling with how to get the results of executing the request. How do I do it?

javaURL = java.net.URL.new svcURL
transferResult = javaURL.getContent()

© Stack Overflow or respective owner

Related posts about jruby

Related posts about java