top | item 39666195

(no title)

Wicher | 2 years ago

You may be able to replace some of your curl+shell with Hurl — https://hurl.dev/#also-an-http-test-tool .

discuss

order

fao_|2 years ago

Why should someone bother to do this, if they already know and have a handle on cURL's syntax?

jicea|2 years ago

Compared to curl, you can:

- chain requests passing data from a request to another,

- add tests on every responses: body, headers, certificates, etc... You can use JSONPath or XPath for example,

- there is some sugar syntax to construct request bodies (GraphQL body is annoying with curl, JSON etc...),

- there is some sugar syntax for retrying requests on asserts, delaying requests etc..

Under the hood, Hurl uses libcurl so a lot of curl's options are exposed through Hurl (and we benefit of a lot of curl features like HTTP/3, IPV4/IPV6 etc... and speed and reliability of course!).

(I'm one of the maintainers)

Wicher|2 years ago

From the first three lines of the linked-to paragraph:

> Hurl can run HTTP requests but can also be used to test HTTP responses. > Different types of queries and predicates are supported, from XPath and JSONPath on body response, to assert on status code and response headers.