Is there a cURL library for Ruby?
If you like it less low-level, there is also Typhoeus, which is built on top of Curl::Multi.
Curb and Curl::Multi provide cURL bindings for Ruby.
There's also Mechanize, which is a very high-level web scraping client, and uses Nokogiri for HTML parsing.
If you know how to write your request as a curl
command, there is an online tool that can turn it into ruby (2.0+) code: curl-to-ruby
Currently, it knows the following options: -d/--data
, -H/--header
, -I/--head
, -u/--user
, --url
, and -X/--request
. It is open to contributions.
Adding a more recent answer, HTTPClient is another Ruby library that uses libcurl, supports parallel threads and lots of the curl goodies. I use HTTPClient and Typhoeus for any non-trivial apps.
HTTP clients is a good page to help you make decisions about the various clients.