24 days of Rust - reqwest

In the first volume of 24 Days of Rust, I've written about hyper as the Rust HTTP toolkit. A lot of things have changed in the last two years, but hyper is still the best solution for HTTP in Rust. However, hyper is undergoing some major changes to use tokio for async I/O. While this will be fantastic for use cases where performance is top priority, it will also make hyper APIs a bit more complex. It's good to know about event loops, futures and services, but sometimes we just want to send a GET request and call it a day.

Sean McArthur created Reqwest specifically for such scenarios. It is a high level HTTP client built on top of hyper. The situation here is somewhat similar to Python, where requests provides a simple API on top of heavy urllib3 machinery. Reqwest is relatively new compared to requests, but it has the same goal - to make simple HTTP requests easy and delegate complex tasks to hyper.

Reqwest also uses OS-provided TLS support if possible. This avoids a lot of pain setting up OpenSSL on Windows.

Continue reading »
Written on Dec. 20, 2016