A fast, mature Ruby HTTP client with a chainable API, streaming support, and fine-grained timeouts.
HTTP.rb is a Ruby gem that provides a fast, feature-rich HTTP client library for making web requests. It solves the problem of Ruby's often cumbersome Net::HTTP by offering a clean, chainable API, native HTTP protocol implementation, and high performance through the llhttp parser. It supports streaming, persistent connections, fine-grained timeouts, and modern Ruby features like pattern matching.
Ruby developers who need a reliable, high-performance HTTP client for APIs, web scraping, or network communication, especially those frustrated with Net::HTTP's complexity or seeking a Requests-like experience in Ruby.
Developers choose HTTP.rb for its mature, clean API that simplifies HTTP interactions, its native implementation offering better control and performance than Net::HTTP wrappers, and its comprehensive feature set including streaming, timeouts, and thread safety, making it a robust choice for production Ruby applications.
HTTP (The Gem! a.k.a. http.rb) - a fast Ruby HTTP client with a chainable API, streaming support, and timeouts
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Method chaining similar to Python's Requests simplifies request building, as shown in examples like HTTP.get('url').to_s, making code readable and concise.
Uses the llhttp parser via a C extension for fast HTTP parsing, avoiding the overhead of Net::HTTP wrappers and improving speed for high-volume requests.
Provides #readpartial for reading response bodies in chunks, enabling memory-efficient handling of large downloads without loading entire responses at once.
Supports Ruby's pattern matching on responses, status, and headers, allowing elegant error handling and data extraction in a declarative style.
Allows connection reuse with the persistent method, improving performance for repeated requests to the same origin, as demonstrated in the base URI examples.
Relies on C extensions for the llhttp parser, which can cause installation issues on systems without a C compiler or in restricted deployment environments.
The README doesn't mention HTTP/2, so users needing modern protocol features like multiplexing must seek alternatives or additional libraries.
For thread-safe persistent connections, the library requires the external connection_pool gem, adding an extra dependency and setup complexity.
Detailed documentation is split between a GitHub wiki and YARD API docs, which can be less accessible and harder to navigate than integrated documentation.