A Ruby HTTP client library that wraps libcurl to make fast and reliable requests with parallel execution support.
Typhoeus is a Ruby HTTP client library that wraps the libcurl C library to provide fast and reliable HTTP request capabilities. It solves the problem of inefficient sequential web requests by enabling parallel execution through its Hydra component, making it ideal for applications that need to handle multiple HTTP calls concurrently. The library offers advanced features like response caching, streaming, stubbing for tests, and support for various authentication and proxy configurations.
Ruby developers building applications that require high-performance HTTP communication, such as web scrapers, API clients, microservices, or tools that need to batch process multiple web requests efficiently.
Developers choose Typhoeus for its parallel execution engine (Hydra), which significantly speeds up batch HTTP operations, and its deep integration with libcurl for reliability and advanced protocol support. Its built-in caching, stubbing for testing, and flexible configuration make it a comprehensive solution beyond basic HTTP clients.
Typhoeus wraps libcurl in order to make fast and reliable requests.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Hydra enables concurrent HTTP requests, significantly improving throughput for batch operations, as shown in the example queuing 10 requests in parallel.
Supports various backends like Rails cache, Redis, and Dalli for efficient response reuse, reducing network calls and latency with configurable TTLs.
Allows chunked response handling via on_body callbacks, enabling large downloads without memory overload, demonstrated in the huge ISO file example.
Provides easy mocking of HTTP responses with Typhoeus.stub, simplifying integration tests without external servers, as detailed in the testing section.
For methods like PUT, developers must explicitly set 'Content-Type' headers for form-encoded data, unlike POST where it's automatic, adding boilerplate code.
Using Hydra requires additional steps for queueing, running, and managing callbacks, making it more verbose than simpler HTTP clients for basic use.
Relies on the C library libcurl, which can cause installation issues, portability concerns, or version conflicts in environments without proper support.