4 ms·
We'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 forma
by jicea 5y ago
We'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.
- nonameiguess 5y agoCan you read a request from stdin? It could just be catted through GNU parallel to launch many hurls concurrently.
- fabricereix 5y agoYes you can. $ echo GET http://google.com | hurl <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="http://www.google.com/">here</A>. </BODY></HTML>