7 ms·
Show HN: Hurl – Run and test HTTP requests with plain text, curl and Rust
- phenkdo 5y agothanks! this looks like something i could use. p.s. coolest and most intuitive name btw.
- ReactiveJelly 5y agoI'm actually curious about the name. OP says "an Hurl request" above. So it's pronounced with a silent "H"? Like "An hour of time?"
- phenkdo 5y agoi'd pronounce it the same way i read it, hurl something.
- evanelias 5y agoDoes no one remember hurl.it? It's a web-based http request tool that has already been using the name Hurl since 2009: https://www.hurlit.com/about/ https://www.hurlit.com/about/ ... originally co-created by one of GitHub's founders no less.
- jicea 5y agoWe're releasing a new version of Hurl, a simple HTTP cli tool built on top of libcurl and Rust. Hurl allows running HTTP requests defined in a plain text format. It can be used to fetch data, or play a scenario (sequence of requests), asserting responses along the way. With its textual format, it is aimed for both devops and developers. With its command-line usage/simple unique binary, it is aimed for both local dev and continuous integration. An Hurl sample: GET https//example.org/books HTTP/1.1 200 [Asserts] jsonpath "$.validated" == true jsonpath "$.books" count == 12 jsonpath "$.books[2].name" == "Dune" Since our first "Show HN" submission [1], we have made the following changes: - full native support on Windows - improve Hurl file format syntax (with md5, sha1, sha256 asserts for instance) - add a tutorial on how to use Hurl [2] - add a simple interactive mode - a lot of bug fixes! In our roadmap, we want to have a better support for package manager (brew, apt etc...), better error feedbacks. We're looking for contributions on improving/correcting our documentation, build an UI client above Hurl, better IDE tooling integration. And last but not least, we would be happy to have feeback on it! [1] https://news.ycombinator.com/item?id=25655737 https://news.ycombinator.com/item?id=25655737 [2] https://hurl.dev/docs/tutorial/your-first-hurl-file.html https://hurl.dev/docs/tutorial/your-first-hurl-file.html
- maverwa 5y agoLooks like something we could actually use for some API smoke tests. I'll bookmark it, thank you!
- woile 5y agoThis looks really cool! Very promising! Is it possible to chain a value from a response to the next request? This would be useful for testing. My understand is that between the header and the body there has to be a new line[0], in the docs seems like it's skipped[1], does it affect functionality if skipped? or is it intentional? Thanks! [0]: https://www.lifewire.com/hypertext-transfer-protocol-817944 https://www.lifewire.com/hypertext-transfer-protocol-817944 [1]: https://hurl.dev/index.html#also-an-http-test-tool https://hurl.dev/index.html#also-an-http-test-tool
- fabricereix 5y agoYes, this is possible to chain a value from a response to the next request. The value is extracted and stored in a variable. This variable can be reused afterward. # Get home: GET https://example.net HTTP/1.1 200 [Captures] csrf_token: xpath "string(//meta[@name='_csrf_token']/@content)" # Do login! POST https://example.net/login?user=toto&password=1234 X-CSRF-TOKEN: {{csrf_token}} HTTP/1.1 302
- certifiedloud 5y agoThe first feature I look for in tools like this is the ability to run requests concurrently. Of course some requests depend on others, but there are often a lot of requests that can be run concurrently to save time. I don't see how to do that with hurl.
- fabricereix 5y agoThis is not possible yet. We have related issues: - https://github.com/Orange-OpenSource/hurl/issues/87 https://github.com/Orange-OpenSource/hurl/issues/87 - https://github.com/Orange-OpenSource/hurl/issues/88 https://github.com/Orange-OpenSource/hurl/issues/88 Running several Hurl files concurrently (and independently) is clear and we will probably add in the next few months. Running requests concurrently in the same Hurl file will be more complicated. The Hurl language has to describe a clear semantic about it.
- ironmagma 5y agoThis is looking like what Postman should have been.
- ceejayoz 5y agoPostman used to be nice and simple like this, and there used to be hurl.it as a web interface for making HTTP requests. I used that a lot. I'm guessing it got abused, though.
- LeonaWilson 5y agoLet’s Secure WiFi Network and Prevent WiFi Hacking- https://www.hackerslist.co/lets-secure-wifi-network-and-prevent-wifi-hacking/ https://www.hackerslist.co/lets-secure-wifi-network-and-prev...
- deleted 5y ago[deleted]
- gizdan 5y agoThere's also dot-http[0] which aims to provide a similar interface to what IntelliJ's requests feature has. I've used it a few times. It's a shame development has died, so hopefully Hurl can take its place. [0] https://github.com/bayne/dot-http https://github.com/bayne/dot-http
- tikkabhuna 5y agoWhen I saw this I was thinking of IntelliJ's HTTP client[1]. I hope that a standardised format can come out of this. [1] https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html#composing-http-requests https://www.jetbrains.com/help/idea/http-client-in-product-c...
- jicea 5y agoYes, we began to work on Hurl three years ago and the file format was "accidentaly" close to IntelliJ's HTTP file format. For the request part, it's not a coincidence since Hurl and IntelliJ's HTTP looks like "bare" HTTP format. They differ drastically on the response tests. We keep working on Hurl because our main goal is to be able to easily run integration tests on a CI or locally in a terminal, which can be difficult with IntelliJ. But yes, this shows that is really a need for such a tool. For reference, IntelliJ format: GET https://httpbin.org/status/200 > {% client.test("Request executed successfully", function() { client.assert(response.status === 200, "Response status is not 200"); }); %} ### Failed test: check response status is 200 GET https://httpbin.org/status/404 > {% client.test("Request executed successfully", function() { client.assert(response.status === 200, "Response status is not 200"); }); %}
- tikkabhuna 5y ago> We keep working on Hurl because our main goal is to be able to easily run integration tests on a CI or locally in a terminal, which can be difficult with IntelliJ. I completely agree with this. Its pushed me away from using IntelliJ's feature. I will always prefer a tool that can be built into a CI pipeline over one that has handy IDE integration.
- enriquto 5y agoThis is seriously cool, and I would use it frequently... if only there was a rust compiler in my computer. Since it is a somewhat "thin" wrapper around curl, are there deep reasons for it to be written in Rust as opposed to, say, C or posix shell? Was learning Rust one of the main goals of this project? (not that there would be anything wrong with that, just asking).
- ironmagma 5y agoIs a Rust compiler really needed? They say there are precompiled binaries available and the package is on several package managers.
- elsombrero 5y agoIn the installation page they just say to download the prebuilt binaries for your system, no need to compile it your self
- ReactiveJelly 5y agohttps://hurl.dev/docs/installation.html https://hurl.dev/docs/installation.html > Precompiled binary is available at hurl-1.3.1-x86_64-linux.tar.gz https://github.com/Orange-OpenSource/hurl/releases/download/1.3.1/hurl-1.3.1-x86_64-linux.tar.gz https://github.com/Orange-OpenSource/hurl/releases/download/... > For Debian / Ubuntu, Hurl can be installed using a binary .deb file provided in each Hurl release. > hurl-bin package for Arch Linux and derived distros. > An installer is available at hurl-1.3.1-win64-installer.exe Just glancing at a few files, main.rs is already over 500 lines, which means shell would be impractical. C is a very difficult language to learn and to use correctly, so in the long-term there will be more Rust (and Go, and Python) programmers than C programmers. I think that is a good reason for projects to choose other languages. In fact, one might equally ask why it wasn't written in Python - Python is safer than C, far easier, and performance doesn't sound critical for an HTTP debugger meant to be used interactively by a human. We're probably already far past the point of "There are more competent Python programmers than competent C programmers."
- lpcvoid 5y ago
- leetrout 5y agoThe Hurl web app was great and has saved me a ton of time in the past. Recently I've replaced Hurl and Postman with the REST Client extension for VS Code. https://marketplace.visualstudio.com/items?itemName=humao.rest-client https://marketplace.visualstudio.com/items?itemName=humao.re...
- certifiedloud 5y agoA lot of people use tools like hurl for integration and smoke tests during CI runs. The extension looks nice, but it is limited in that way.
- leetrout 5y agoSo what we really need is a nice VS Code extension for Hurl.
- benatkin 5y agoIt's still there: https://www.hurlit.com/about/ https://www.hurlit.com/about/ Recently acquired in fact.
- ceejayoz 5y agoInteresting; is that someone rehosting the original app? https://hurl.it/ https://hurl.it/ got bought at some point.
- benatkin 5y agoIt was relaunched 5 months ago, and if you go on WayBack Machine, it seems it hasn't changed at all, except perhaps to add a Captcha. I think they probably plan to do more with it, and thus there's a name conflict for hurl.dev.
- osener 5y agoReminds me of https://github.com/pashky/restclient.el https://github.com/pashky/restclient.el. Nice to see an editor-agnostic version of this idea, great job!
- brabel 5y agoAlso similar to the Jetbrains HTTP textual client: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html https://www.jetbrains.com/help/idea/http-client-in-product-c... It uses JS to perform assertions though.
- jedimind 5y agoI suggested that same, then I saw your comment, so I deleted my comment and upvoted yours instead. Happy to see these gems becoming more popular.
- zshrdlu 5y agoMe three!
- benatkin 5y agoAt first I thought it was this: https://www.hurlit.com/about/ https://www.hurlit.com/about/
- gt5050 5y agohttps://curl.link/ https://curl.link/ Shameless plug, built this small tool to share curls.
- Kinrany 5y agoTangentially related: does anyone do Pact-like consumer-driven testing? Are there good articles about testing services in Rust?
- taf2 5y agoAh reminds of hurl.it - loved that service...
- sandes 5y agoKeep up the good work :)
- deleted 5y ago[deleted]