Curl vs. reqwest #3370
-
Just out of curiosity, would you use Curl again today, or would you use reqwest instead? Are there any features that can only be implemented with Curl? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I am not a maintainer but: Actual answerMy assumption on one of the features (@jcamiel, pls correct me if I am wrong): hurl test.hurl --very-verbose that prints the curl command that would replicate the call that hurl made would not make sense or is inaccurate if Hurl would not use Curl. My experience about the topic of CurlIt was easy to argue about why we should use it in the Company because it uses curl under the hood. Many of our Devs were anxious about how it works under the hood and thought in the beginning it would make magic things when doing the request. People trust Curl to be secure, well maintained and fast. Of course reqwest is also all of those things, but if you are not living in Rust world, Curl sound a lot more familiar and a safe bet. When working and trying out things with Hurl, it felt good because you knew when someone else calls the endpoint with pure curl on their machine it will behave the same. So there was never a "it works on my machine". |
Beta Was this translation helpful? Give feedback.
-
Hi, When we started coding Hurl (years ago before going open source on GitHub), we played with reqwest as the underlying HTTP engine.
Searching for it, Tomcat 8.x used to respond with a response phrase and we encoutered instances where this reason phrase was localized... At the time, the Rust component was panicking on this HTTP response, while curl happily returned the response without blicking. We realized the benefit of having a super robust HTTP library. Bonus point: debuging Hurl was (and is still) super easy, you just have to make the same curl command and see what's the difference. There was also a solid Rust crate that was doing the binding between libcurl and Rust, and We switched to curl and, as @SilenLoc just says, it has been now a selling point of Hurl: it's just curl under the hood. Also, we were proposing a completly new file format and having a known reliable HTTP component allowed us to focused on the "icing cake". Finally, important HTTP features are really super simple to implement:
A final example is, for instance, the ability to use any curl options (provided they're in libcurl). Just doing this kind of request:
while the executed HTTP request is :
instead of
is possible in Hurl because we're exposing So, very very very happy to rely on curl! |
Beta Was this translation helpful? Give feedback.
Hi,
When we started coding Hurl (years ago before going open source on GitHub), we played with reqwest as the underlying HTTP engine.
We encountered an HTTP server that was sending a localized reason phrase, ie "200 succès" instead of "200 OK", something like:
Searching for it, Tomcat 8.x used to respond with a response phrase and we encoutered instances where this reason phrase was localized...
At the time, the Rust component was panicking on this HTTP response, while curl happily returned the response without blicking. We realized the benefit of having a su…