About taf2/curb
Curb provides Ruby-language bindings for libcurl, a fully-featured client-side URL transfer library. It supports libcurl's easy and multi modes, enabling HTTP GET/POST requests, FTP operations (download, upload, directory listing), and FTP over HTTP proxy tunnel. A key advantage is its ability to handle timeouts without using threads, setting it apart from other Ruby HTTP libraries. Curb is open-source and released under the Ruby license.
Key Features
Ruby-language bindings for libcurl
Supports easy and multi modes
HTTP GET and POST requests with timeout control
FTP download, upload, and directory listing
FTP over HTTP proxy tunnel support
Timeout handling without threads
Set custom headers and content types
Pros & Cons
Pros
- Handles timeouts without the complexity of threads
- Full access to libcurl's extensive features
- Supports both simple (easy) and concurrent (multi) request modes
- Includes FTP functionality with proxy support
- Well-established open-source project with active maintenance
Cons
- Work-in-progress, currently limited to easy and multi modes only
- Requires libcurl library to be installed on the system
- Documentation may be sparse for advanced features
Best For
HTTP/HTTPS API interaction from Ruby applicationsFTP file management (download, upload, list directories)Network programming requiring fine-grained control over requestsScraping or data retrieval with timeout guaranteesFTP through corporate HTTP proxies
FAQ
What is Curb?
Curb is a Ruby gem that provides bindings for libcurl, enabling Ruby programs to perform HTTP, HTTPS, and FTP requests with features like timeout control and proxy support.
What are the advantages of Curb over other Ruby HTTP libraries?
A major advantage is its ability to handle timeouts without using threads, which simplifies concurrent programming and avoids thread-related issues.
Does Curb support FTP?
Yes, Curb supports FTP operations including download, upload, directory listing, and FTP over HTTP proxy tunnel using CONNECT.
Is Curb production-ready?
Curb is labeled as work-in-progress but is widely used. It currently supports libcurl's easy and multi modes, which cover many use cases.