3 ms·
There is hundreds if not thousands of rust crates for http to choose between. `reqwest` is just one of many other popular alternatives, all built for different
by diggan 2y ago
There is hundreds if not thousands of rust crates for http to choose between. `reqwest` is just one of many other popular alternatives, all built for different sorts of tradeoffs.
- jjice 2y agoMost of them are built on top of hyper, including reqwest [0] (not a bad thing, they're just still hyper). I personally wouldn't even consider hyper as an HTTP client for use in most projects, but reqwest adds a much more approachable API on top of hyper. [0] https://github.com/seanmonstar/reqwest/blob/master/Cargo.toml https://github.com/seanmonstar/reqwest/blob/master/Cargo.tom...
- worik 2y agoAnd to get a simple https request you end up with about 200 crates in your tree
- jdiez17 2y agoThis is an (unfortunate?) part of the Rust ecosystem. Reminds me of the JS/NPM mess. I think it is a bit better in the Rust world, but I’m still undecided if it is acceptable to have so many crate dependencies for conceptually simple programs.
- Klonoar 2y agoNo, there are smaller crates out there that enable a simple https request with far less crates. Much of that is due to not needing Tokio & co.
- worik 2y agoYes. Part of the problem is there are so many, which do you choose? I found one (I forget the name to protect the guilty) but my simple use case broke it. I reached out to the authors, very helpful, I think they fixed it. But by then I had moved on (time is money) I sucked it up and went with importing all the tokio stuff I did not need (I absolutely did not need, almost no one does) Rust has painted itself into a corner. A really very good idea at its core, almost all of it is really terrific, but some corner cases like these make it very hard to take advantage of it
- Klonoar 2y agoDeciding which one to try isn't hard at all: `ureq` is the de-facto small HTTP library that you'd reach for, and you're likely to find people referencing it within 2 minutes of Googling. The only thing `ureq` was missing that's common (ish) was a happy eyeballs implementation, and they've recently handled it. This just isn't a significant problem at all.
- worik 2y ago> Deciding which one to try isn't hard at all Nonsense. If you are steeped in HTTPS clients for Rust, maybe, but I can tell you from personal experience that coming fresh to https://crates.io/search?q=https%20client https://crates.io/search?q=https%20client and friends is overwhelming
- Klonoar 2y agoA few minutes in Google would've saved you that confusion, same way it works for any other package manager.