RestClient for JRuby
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
MIT-LICENSE
NOTICE.txt Adding NOTICE for Apache 2.0 license and JAR files Mar 27, 2009
README
commons-codec-1.3.jar
commons-httpclient-3.1.jar
jruby_restclient.rb

README

JRuby-RestClient is a wrapper for Java HttpClient. You would use this client if you need timeouts to work correctly for a JRuby application (as of 1.1.6, they do not).

There are two packages that are needed to get this to work:

1. HttpClient (http://apache.mirrors.hoobly.com/httpcomponents/commons-httpclient/binary/commons-httpclient-3.1.tar.gz)
2. Codec (http://commons.apache.org/downloads/download_codec.cgi)

These are included along with the Apache license in NOTICE.txt. Please let me know if these should be unbundled.

JRestClient works like Adam Wiggin's REST client (or ... like a grotesque facsimile of it):

RestClient.get "http://127.0.0.1:3000/resource", {:header => 123}
RestClient.post "http://127.0.0.1:3000/resource", {:key => 'value'}, {:header => 123}

The one thing this introduces over Adam Wiggin's plugin is a global timeout (it's relatively easy to get it working in the MRI version of the gem, unfortunately JRuby doesn't treat it right since it'll block on I/O).