The HTTP Gem 0.5.0: HTTP (and streaming) should be easy!

The HTTP Gem provides an easy-to-use JQuery-like chaining API for
constructing HTTP requests. It’s similar to the Requests library from

gem install http

Find it on Github at: GitHub - httprb/http: HTTP (The Gem! a.k.a. http.rb) - a fast Ruby HTTP client with a chainable API, streaming support, and timeouts

The HTTP Gem is also compatible with Celluloid::IO and can be used to
multiple parallel requests easily, similar to what you can do with gems
like Typhoeus.

Here’s how you can write a parallel HTTP fetcher that runs in a single
thread using Celluloid::IO:

– snip –

require ‘celluloid/io’
require ‘http’

class HttpFetcher

include Celluloid::IO

def fetch(url)
HTTP.get(url, socket_class: Celluloid::IO::TCPSocket).response

fetcher =

urls = %w(

Kick off a bunch of future calls to HttpFetcher to grab the URLs in

futures = { |u| [u, fetcher.future.fetch(u)] }

Consume the results as they come in

futures.each do |url, future|

Wait for HttpFetcher#fetch to complete for this request

response = future.value
puts “Got #{url}: #{response.inspect}”

– snip –

Full CHANGELOG follows:

  • Add query string support
  • New response delegator allows HTTP.get(uri).response
  • HTTP::Chainable#stream provides a shorter alias for
  • Better string inspect for HTTP::Response
  • Curb compatibility layer removed