26 ms·
Hurl 4.0.0
- krat0sprakhar 3y ago> Hurl is a command line tool powered by curl, that runs HTTP requests defined in a simple plain text format: <code sample> This is how every new version announcement should start! I'd never heard of Hurl before and that intro + code sample on top instantly made me want to install and try it out. Congrats on what seems like a great release
- jicea 3y agoHi, maintainer of Hurl and avid reader of Hacker News for years. I've noted every advice for presentations (put a sample of your language asap, explain your concept every time succinctly, etc...). I've tried to put it in practice on hurl.dev so thank you for noticing it!
- TavsiE9s 3y agoThat's one of the reasons why I bookmarked it and will test it in various CI pipelines on Monday. ;-)
- rockwotj 3y agoMind sharing this list? :)
- 9935c101ab17a66 3y agoYes! I would love to see the list even if it’s rough around the edges.
- wanderingstan 3y agoAmen. Far too many announcements and readmes jump right into installation requirements and “we’ve fixed X, Y and Z” but never actually tell you what the thing is!
- convalescindrey 3y agoA changelog is supposed to tell you what has changed. A general greeting/landing page is supposed to tell you what the thing is. Trouble is if a link to a changelog is submitted to HN. Most people who don't know what the thing is click on it, have no clue what they are looking it, close it again and then downvote the submission. Submissions for not-widely-known stuff should be a landing page, not a changelog page. (In other words, this hurl page is kind of a mix between these two which is odd and arguably misusing what a changlog / news announcement page should be.)
- jicea 3y agoWe've a more "classic" changelog in GitHub [1], I see the blog post as an editorial view of the changelog: highlights of main features/changes with some context. [1] https://github.com/Orange-OpenSource/hurl/releases/tag/4.0.0 https://github.com/Orange-OpenSource/hurl/releases/tag/4.0.0
- phist_mcgee 3y agoMy favourite is landing on a github repo for a project and reads like the following: Schmaggle is the new hyperlayer to solve excess Flingles when re-routing Blumbles in non-zero p=np equations. Please open a PR if you're interested. Or something to that effect.
- jpalomaki 3y agoHappy to notice the "Locate the logo on top left corner and click" works in this case! I'm immediately forward to a page that provides exactly what I need.
- bandrami 3y agoWhat irks me is when the project description focuses on "Updog is written from scratch in Deactivated Typeflange" or whatever. So many github readme's where I have a pretty good idea about why the devs chose the language and toolchain they chose but zero idea of what the project does and why I might want to use it.
- ShadowBanThis01 3y agoTrue, except most of that should have been in the title of the post. Such as: Hurl: Run HTTP requests in a simple plain-text format
- Alifatisk 3y agoInteresting project, might try it out!
- hiddew 3y agoNever heard of this! I will definitely take a look if this can replace some handwritten bash curl-based test scripts to validate HTTP-level interactions. The combination of documentation and testing in a single text file looks promising.
- hermanradtke 3y agoNice QoL improvements. Hurl is my go-to for any Postman-like problem. It is much easier to maintain and share hurl script then it is for me to share a Postman json blob.
- dgellow 3y agoI learned today that Visual Studio 2022 has support for something similar with .http files: https://learn.microsoft.com/en-us/aspnet/core/test/http-files https://learn.microsoft.com/en-us/aspnet/core/test/http-file.... Hurl seem to have way more features.
- gossamer 3y agoI have never wanted to hurl more than I do now. But in a good way. :-)
- klysm 3y agoI have no idea what you are trying to say
- ISO-morphism 3y agoTo hurl means to throw forcefully, and is commonly used as a synonym for vomiting, c.f. "throw up"
- isanjay 3y agoI used it briefly and found it very fast.
- smarkov 3y agoPlease make this the industry standard for testing APIs. I'm tired of having to look at Postman screenshots sent from QA. I'm tired of having to wait for them to press Send once I've implemented a fix. I know they're tired of waiting for me to do that, too. Hurl is something both the devs and QA can speak and write. It can be automated and a part of CI. It makes communicating expectations straightforward. It can be chucked along with PRs as a starting point for QA. I don't see a reason not to use it wherever possible.
- digikata 3y agoI have been using it for API testing manual and in CI of one of our services and it's been very nice. You can basically put a series of http exchanges for a workflow per hurl file and get a nice test suite that also checks directly into git.
- vidyesh 3y agoFor a team using VSCode you can try the vscode-restclient[1] But really Hurl looks really interesting, being editor agnostic is the best solution for your problem, I agree. [1] https://github.com/Huachao/vscode-restclient https://github.com/Huachao/vscode-restclient
- kxrm 3y agoI use the vscode-restclient and my primary reason is the conversational flows you can build against an API. Does Hurl support this? If so I would absolutely switch. All I would need to complete the experience is a plugin to do highlighting and integration with the Hurl files.
- steve_adams_86 3y agodigikata’s comment above suggests it is possible. It would be great to have something that isn’t attached to the editor of choice.
- kxrm 3y ago
- utybo 3y agoI really like httpyac for this purpose: https://httpyac.github.io https://httpyac.github.io Pretty similar with JS scripting capabilities. Has great VS Code integration in addition to its CLI.
- brewmarche 3y agohttpyac is also very compatible to .http support in JetBrains IDEs. JetBrains also offers a free CLI tool to generate jUnit test reports from .http files.
- jiehong 3y agoGreat job to the team! Hurl is growing rapidly! One question if someone knows: while testing an endpoint, authentication is always needed. Having written the authentication in 1 file, how can I import this file at the beginning of every other file that requires authentication and the associated token?
- bityard 3y agoIt doesn't look like Hurl has any functionality for inclusions, macros, and the like. I'm not sure those would be the best way to store and use secrets anyway. But the docs say you can pass variables into hurl files via command line args and through the environment: https://hurl.dev/docs/templates.html https://hurl.dev/docs/templates.html
- pmarreck 3y agoThis looks like a great tool to put in charge of regularly testing your site performance in a dashboard or incorporating into CI somehow. Has anyone done anything like this as, say, a Github Action, in a workflow? I see that there is this https://github.com/marketplace/actions/install-hurl-cross-platform https://github.com/marketplace/actions/install-hurl-cross-pl... but I'm not sure how it would look in such a use case- a "performance test" stage perhaps? with logging over time to some other service?
- jicea 3y agoYou can check: - GitHub CI/CD integration example in the Hurl documentation [1] - a blog post from GitLab about how to integrate Hurl in GitLab CI/CD [2] [1]: https://hurl.dev/docs/tutorial/ci-cd-integration.html https://hurl.dev/docs/tutorial/ci-cd-integration.html [2]: https://about.gitlab.com/blog/2022/12/14/how-to-continously-test-web-apps-apis-with-hurl-and-gitlab-ci-cd/ https://about.gitlab.com/blog/2022/12/14/how-to-continously-...
- compumike 3y agoPretty interesting! It makes me wonder, would anyone want a hosted version that runs checks against your production API endpoints / websites periodically? We have these basic capabilities (for example, assert headers, status code) as part of Heii On-Call’s HTTP outbound probes [1] but a more powerful assertion syntax might be interesting for some use cases. (Or are the basics good enough for Continuous Monitoring? And the advanced assertions more interesting for CI?) [1] https://heiioncall.com/blog/enhanced-api-monitoring-with-expected-http-header-verification https://heiioncall.com/blog/enhanced-api-monitoring-with-exp...
- debarshri 3y agoWe at Adaptive[1] extensively use hurl.dev to automate our testing. All our internal product flows are tested via hurl. It is the best thing that we have ever implemented in our org to stabilize the product. Everytime before we deploy, we run bunch of automated tests written in hurl, for onboarding, signups, critical flows etc. That are containerized and can run in parallel. We have been building internal tools around hurl.dev too. I really would recommend this tool. Nice thing is even analyst and business users can build these tests as it is fairly easy to pickup. [1] https://adaptive.live https://adaptive.live
- sedatk 3y agoDoes it support OAuth flow out of the box, or do you need hardcoded tokens for that? (I checked the docs, couldn't find anything about it)
- debarshri 3y agoTo my best knowledge, it does not support oauth flow out of the box. This is also where we built some custom tooling around hurl.
- klysm 3y agoIt seems reasonable to not support all the different auth schemes though. There are so many implementation quirks that it would be a huge burden to do that as part of the hurl project
- digikata 3y agoIt doesn't support that out of the box, but you you can specify or capture values for variables like tokens in the hurl tests. https://hurl.dev/docs/manual.html#variable https://hurl.dev/docs/manual.html#variable https://hurl.dev/docs/capturing-response.html https://hurl.dev/docs/capturing-response.html
- JeremyNT 3y agoI'm curious as to why you use this standalone tool versus a full fledged test suite. It seems like a browser based approach (like Selenium) would be far more powerful and overall useful in a testing context.
- kemotep 3y agoAt first, I thought this was the toy language Hurl[0] and was shocked the developer made it to version 4 so quickly. Really cool tool built with curl. Certainly could replace a bash script or two with something more robust. [0]: https://news.ycombinator.com/item?id=36393673 https://news.ycombinator.com/item?id=36393673
- ryenus 3y agoTurned out that one was, as you said, a totally unrelated toy language, nothing like this hurl.dev one.
- zgluck 3y agoFeedback: The homepage (https://hurl.dev/ https://hurl.dev/) doesn't really make it clear - is this an interactive tool or not? If I understand it correctly, you're supposed to save that example as a file and run 'hurl example.hurl'. It would make it easier to understand if that sample code box had a headline saying e.g. [example.hurl].
- mxuribe 3y agoI'm not the author, but after reading the manual (https://hurl.dev/docs/manual.html https://hurl.dev/docs/manual.html), it seems to me that the tool can be used both ways. That being said, i think the value of this tool (beyond a tool like curl, wget, etc.) is that its likely preferable to base usage on non-interactive use, or at least leverage the tool via its .hurl files. While i actually like the succinctness of the homepage in describing this tool, you're not wrong that the author could have added an additional sentence stating the interactive or not point slightly more clearly. Even still, the documentation is much better for this tool, than other tools that i have seen. For this i'm thankful!
- jicea 3y agoNoted, I'll try to make it clearer. We’ve been more explicit on the samples page [1] [1] https://hurl.dev/docs/samples.html https://hurl.dev/docs/samples.html
- jicea 3y agoWould it be more clear if we put line numbers in Hurl file snippets (even on the home)? I like the simplicity of our docs, but I can understand that it isn't clear how to use it. By the way, that's why we have put an asciinema animation on the home page, starting with `vim my_file.hurl`
- zgluck 3y agoIt would help a little bit, yeah.
- letmeinhere 3y agoIs anybody else wary of a new grammar with no transformer available to/from anything more common (e.g. json/xml)? I did find [this][1] tree-sitter parser, so that's a start, but it seems like writing these would be a lot easier to write these if the interface was a library in a general purpose language or a subset of json. [1] https://github.com/pfeiferj/tree-sitter-hurl https://github.com/pfeiferj/tree-sitter-hurl
- jicea 3y agoYou can export Hurl file to JSON with hurlfmt. We've done this so you can go to another tool if you prefer and convert your tests. It may be a start. The Hurl parser is also available as a library through Rust crates.
- sergiotapia 3y agoI will try to integrate this into our workflows. Hurl looks great!
- bityard 3y agoThis is one of the best examples of a modern Unix program I have seen: - It accepts input on stdin - It sends output to stdout - Does not appear to be littered with unicode emoji everywhere - It comes with man pages (and pretty good ones too!) - The hurl file extension is four characters long instead of three, thank goodness we're finally past MS-DOS compatibility concerns! This looks like something I might take seriously.
- sedatk 3y ago> thank goodness we're finally past MS-DOS compatibility concerns! and VMS!
- EdwardDiego 3y agoI never realised how much the emojis in my terminal annoyed me, until you mentioned this didn't have them, and I got excited.
- insanitybit 3y agoThis is great, I love the native jsonpath support.
- miki123211 3y agoSpeaking of command line HTTP handling, my favorite tool for that is Httpie[1], or rather its faster Rust rewrite, XH[2]. It lets you issue HTTP requests from the command line with much nicer, more HTTP-like syntax than CURL and without the need to learn so many switches. If you already know curl well, it probably won't be of much use, but it's far, far more intuitive for casual use. [1] https://httpie.io/ https://httpie.io/ [2] https://github.com/ducaale/xh https://github.com/ducaale/xh
- thunfisch 3y agoHurl and it's test cases have been awesome at our Ops team. We're managing an autogenerated config for hundreds of complex webserver rules, and we've been able to (auto-)generate hurl test cases for every single rule and test them in both CI and the actual infrastructure after deploying. It's simplicity but powerfulness is amazing!
- kristopolous 3y agoAre there use cases beyond testing that anyone here has actually done?
- mxuribe 3y agoActually done? No. However, one use-case that i couild think of - beyond testing - would be to modularize some dev work. For example, maybe i have a junior dev who knows some http, but not experienced enough to be a lead dev, or something like that. I could give the junior dev a task like draft up some tech spec...Or, i could have them use their basic http skills and craft Hurl files...one for each function that will inevitably be a function in code...either to be done by a more senior dev, or who knows, maybe this same junior dev could eventually learn to code based on their own hurl files...which someone else might call pseudo-code (or pseudo-code in tech docs)...which eventually gets turned into production code...and those same hurl files can also be turned into test cases. Anyway, for me, hurl looks like an evolution of curl...which makes sense since its built off of curl (https://hurl.dev/#powered-by-curl https://hurl.dev/#powered-by-curl). So, for uses-cases that might reach beyond curl, that's when i might reach for hurl as well. No doubt, there could be other use-cases for hurl.
- bachrc 3y agoAs other people, I really think this is a great piece of software, but I didn't ser any way of reusing hurl file in anothers? For intégration testing, this would be much more cleaner
- smartmic 3y agoEmacs enthusiasts have https://github.com/pashky/restclient.el https://github.com/pashky/restclient.el I see some parallels to Hurl, but having everything inside Emacs is hard to beat, just thinking about using M-x jq-interactivly for json responses ...
- rrgok 3y agoI've been following hurl for sometime. Where it shines from others is that it has its own DSL For testing. It is not only to make http request, but to assert response and capture data. Having said that, and hoping the maintainer is reading this: please please make it such that assertion can passed to an external script. Why am I asking this? Because, an example, you cannot still assert that a property in a collection of items all have the same value (ex.: all titles should be XXX without using nth selector or make it possible to do nth = * ). And proving a DSL for all use cases is kinda huge effort. Would be great to pass the the output of jsonpath to jq for example and if that returns true, the test pass.
- klysm 3y agoThe DSL would slowly creep to a Turing complete general purpose language so I agree that invoking external scripts seems reasonable. The could be quite a can of worms though because it makes the files less hermetic
- mcpeepants 3y ago> it makes the files less hermetic what if the script was inline in the DSL? e.g. some syntax for opening a script “block”, with an annotation of the command to exec or pipe the script into
- klysm 3y agoThat seems fine but what language do you use? Lua?
- lfconsult 3y agoI really do love this project . Using it in production for testing purposes. Great job guys.
- johntash 3y agohurl is great, glad to see it's being improved on. I wrote a small wrapper around it a while back to be able to re-use some auth stuff in different requests, but a simple "include <file.hurl>" would be an awesome addition in a future release. Getting started with it was way easier than figuring out postman or any of the many other http testing frameworks with their own languages/dsls
- v3ss0n 3y agoCheck: https://hexmos.com/lama2/tutorials/examples.html#headers https://hexmos.com/lama2/tutorials/examples.html#headers Similar to hurl and it has built-in postman import.
- wraptile 3y agoI feel like DSL is becoming obsolete these days in favor of general programming (e.g. Python). I really like Hurl but every time we use it we revert back to simple Python because something is slightly off or missing (they just added XPath support) or different and just writing up Python script is easier and more powerful. Onboarding people on Python test suite is much easier than teaching them whole DSL that they'll be using few times every month.
- ezekiel68 3y agoCan anyone who's used hurl explain whether there are any use cases where something like Postman can do something hurl can't or can do it much better? I haven't used Postman very often previously but at work my role may change to require much more testing work (that many in the industry would have traditionally used Postman for).
- jicea 3y agoI can't speak for Postman, but at work we use Hurl intensively in our CI/CD. Test files are commited, and using comments in Hurl files serve as a documentation of requests workflows. Another Hurl use case is, instead of testing APIs, you want to download datas. Like curl, Hurl can output an HTTP response body. Unlike curl, this response can be the last one of a complex workflow (data behind login for instance, you need to capture data from one request and inject in another request like CSRF tokens). Disclaimer: I'm one of the Hurl maintainers.
- malablaster 3y agoHurl looks like a game changer for me. The fact that there’s a session shared within a file means as a backend dev I may be able to trivially eliminate the browser from my dev flow (without a bunch of annoying scripts). I’m on vacation and can’t wait to try this back at work.