4 ms·
My two cents (as a developer of Hurl): - chaining requests, - passing data from a request to another (with captures or with cookies, each file being its own c
by jicea 4y ago
My two cents (as a developer of Hurl):
- chaining requests,
- passing data from a request to another (with captures or with cookies, each file being its own cookie session),
- gettings resources and checking payload SHAS
- checking responses (JSONPath, XPath on body response, headers etc...)
- retry / polling scenarios (polls until a resource is created for instance)
- comments things (we use Hurl as documentation for APIs workflows)
You can do these things using scripts and curl of course. We appreciate having a tool that works locally on Windows / macOS / Linux and integrates nicely in CI/CD. Hurl uses a (very small) fragment of libcurl. curl is much much powerfull, we love it.
- account-5 4y agoThanks for the quick reply. I've used curl on windows before calling it from AHK for quick dirty one off scripts. Hurl could replace that with the ability to chain requests. Thanks.
- justonemore3 4y agoCan't this not be easily done using curl | xargs | jq + bash chained as often as you like
- jicea 4y agoEmulating an HTTP session (with cookies passing) between request is more complicated for instance. Retry based on response content is doable but easier with a declarative format. jq is perfect for JSON response, what about HTML/XML response? Our testers prefer to write a text based declarative test, instead of a Bash script. It depends on your needs/backgrounds.
- nerdponx 4y agoAt that point wouldn't you want to use Python, Node, Ruby, etc?
- brigandish 4y agoUsing a binary can be (in my experience, 99% of the time) an enormous convenience and performance boost over including a whole runtime for those languages.
- defanor 4y ago> Emulating an HTTP session (with cookies passing) between request is more complicated for instance. Are cookie jars not sufficient for that? Curl supports those on its own.
- justonemore3 4y agoThanks four your reply - just had restful services in my mind when writing my response.
- Too 4y agoWhy use a DSL and not your favorite scripting language or test-framework of choice for this? All the examples on the front page can be written in same number of LOC in many such popular languages. - chaining - It's just code so put multiple get calls after one another - captures - Just variables. With sessions you can also get automatic cookie-capture. - Payload - Yes - Parsing responses - stdlib has json and xpath libraries that also can be written as oneliners. Html not always being pure xml is a problem, but can be solved with other libraries, like beautifulsoup. - Retries - a bit more hassle to set up but also doable with relatively small effort. - Comments - yes What's missing would be benefits given by the declarative nature, such as more human friendly output on jsonpath assertions. But that's often easily extended with functions in the test framework and outweighed by the flexibility given by allowing you to extend the capabilities with more functions or put computations between chained calls or other external inputs/outputs needed in the tests. How often do you really need to test only the http call and nothing else?