Http.rb 0.7.0: a fast, streaming HTTP library with a chainable API

http.rb is an HTTP client library which exposes an easy-to-use chainable
API for constructing HTTP requests:

To install it:

gem install http

To use it:

require 'http'

It’s that easy!

http.rb was previously named “The HTTP Gem” and located under “tarcieri”
Github, however we have rebranded and put it under its own organization
hopes of improving discoverability and SEO.

This library implements the HTTP protocol from-scratch without any
dependencies on Ruby’s Net::HTTP. It uses the http_parser.rb library, a
native extension containing the Node.js parser for CRubies and a Java
thereof for JRuby.

The entire library has been written from the ground up to support
end-to-end streaming.

The API is inspired in part by the Requests library from Python:

Full change log below:

  • Fix handling of EOF which caused infinite loop. See #163, #166 and
    (@mickm, @ixti)
  • Drop Ruby 1.8.7 support. (@ixti)
  • Fix default Host header value. See #150. (@ixti)
  • Remove BearerToken authorization header. (@ixti)
  • #auth sugar now accepts only string value of Authorization header.
    Calling #auth(:basic, opts) is deprecated, use #basic_auth(opts)
  • Fix handling of chunked responses without Content-Length header.
  • Remove HTTP::Request#method and deprecate HTTP::Request#__method__
  • Deprecate HTTP::Response::STATUS_CODES,
    use HTTP::Response::Status::REASONS instead (@ixti)
  • Deprecate HTTP::Response::SYMBOL_TO_STATUS_CODE (@ixti)
  • Deprecate HTTP::Response#status_code (@ixti)
  • HTTP::Response#status now returns HTTP::Response::Status. (@ixti)
  • HTTP::Response#reason and HTTP::Response#code are proxies them
    to corresponding methods of HTTP::Response#status (@ixti)
  • Rename HTTP.with_follow to HTTP.follow and mark former one as
    deprecated (@ixti)
  • Delegate HTTP::Response#readpartial to HTTP::Response::Body