Skip to content

hurl HTTP tester

Posted on:15 December 2022 at 14:48

Hurl is an HTTP testing tool written in Rust which can test http responses for status code, headers, and even content. Requests can be chained together to test multiple endpoints.

Example:

hurl --test example.hurl

Here is the example.hurl which checks that a website supports conditional GETs.

GET https://hurl.dev/

HTTP/2 *
[Asserts]
status == 200
[Captures]
lastModified: header "Last-Modified"
etag: header "ETag"

GET https://hurl.dev/
If-Modified-Since: {{lastModified}}
If-None-Match: {{etag}}

HTTP/2 *
[Asserts]
status == 304