Hacker News new | ask | show | jobs
by axus 980 days ago
I know almost nothing about the Rust ecosystem but am interested. What Rust packages could completely replace Curl? The top result on Google suggested hyper and reqwest.
2 comments

You'd need a few different ones, just like curl itself uses a lot of 3rd-party libraries to provide its full feature set.

Some likely first choices would be hyper (http client/server), rustls (encryption), tokio (async scheduling). The Rust ecosystem is quite rich in protocols and codecs, it shouldn't be too hard to find most (all ?) of the crates you need, but there's still work needed to bring them together into one curl-like tool.

Note that Rust crates tend to be more focused than what you're used to in C, made to be composed together instead of used as a one-stop-lib. So your dependency tree would look much bigger than curl's.

Curl supports a lot of protocols, including surprising ones like LDAP, SMTP and POP3, so there is no exact curl replacement anywhere, but Rust already has libraries for every protocol that Curl supports.

Hyper is a pretty robust HTTP toolkit, and reqwest is a higher-level library on top of it.