[ANN] HTTP (The Gem!) 2.0.0: a fast, elegant HTTP client for Ruby

2,491 views
Skip to first unread message

Tony Arcieri

unread,
Apr 23, 2016, 7:27:53 PM4/23/16
to http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API, ruby-talk ML
HTTP (The Gem!, a.k.a. http.rb) provides an elegant, chainable interface for building HTTP requests, similar to Python's "Requests" library. Think ActiveRecord or JQuery for building HTTP requests. Its API is hopefully intuitive and just does what you expect (unlike, say, Net::HTTP).


Unlike most other Ruby HTTP clients which aim to provide a good API, it is *not* built on top of Net::HTTP, but instead natively implements the HTTP protocol, building on the natively implemented http_parser.rb gem (which contains the Node.js parser and a Java port for JRuby). This makes http.rb one of the fastest Ruby HTTP clients available. It also supports persistent "keep-alive" connections and fine-grained timeouts implemented using an asynchronous socket layer instead of timeout.rb (which has thread safety problems).

The 2.0.0 release includes some breaking API changes: we dropped Ruby 1.9 support and changed the exceptions raised for I/O errors so they're all subclassed from HTTP::ConnectionError, which should make error handling easier.

A handful of other issues were fixed. You can find them documented in CHANGES.md.

--
Tony Arcieri

Peter Fitzgibbons

unread,
Apr 28, 2016, 8:35:23 AM4/28/16
to http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API, ruby...@ruby-lang.org
Dude!  Tony you are officially my hero.   

I have used HTTP in Ruby with trepidation for years and years due to Net::HTTP's terrible timeout code.
Thankyou for producing a correct implementation!

- Peter Fitzgibbons

Tom Wardrop

unread,
Apr 30, 2016, 6:54:18 PM4/30/16
to http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API, ruby...@ruby-lang.org
Good job Tony. Always like to see people making better libraries like this. Will definitely use in the future.
Reply all
Reply to author
Forward
0 new messages