LinuxCommandLibrary

hurl

Run and test HTTP requests with plain text

TLDR

Run requests from a Hurl file

$ hurl [path/to/file.hurl]
copy
Run in test mode with progress reporting
$ hurl --test [path/to/file.hurl]
copy
Run with verbose output
$ hurl --verbose [path/to/file.hurl]
copy
Run with a variable
$ hurl --variable [name]=[value] [path/to/file.hurl]
copy
Run multiple files in parallel
$ hurl --parallel [path/to/file1.hurl] [path/to/file2.hurl]
copy
Output results as JSON
$ hurl --json [path/to/file.hurl]
copy
Run with retry on failure
$ hurl --retry [3] [path/to/file.hurl]
copy

SYNOPSIS

hurl [options] [FILE ...]

DESCRIPTION

hurl is a command-line tool that runs HTTP requests defined in simple plain text .hurl files. It can chain multiple requests, capture values from responses, and evaluate assertions on headers, status codes, and body content using XPath, JSONPath, and regex queries.
Hurl supports REST, SOAP, GraphQL, and any XML/JSON-based API. It handles authentication, cookies, form data, multipart uploads, and binary bodies. Built in Rust and powered by libcurl, it is a single binary with no runtime dependencies.
Hurl is designed for both fetching data and testing HTTP sessions, with built-in support for assertions on response status, headers, body content, duration, and SSL certificates. Multiple report formats (text, JUnit, TAP, HTML) make it easy to integrate into CI/CD pipelines.

PARAMETERS

-u, --user user:password

Add basic authentication credentials
-H, --header header
Add a custom HTTP header
-L, --location
Follow HTTP redirects
--test
Activate test mode with progress reporting
--json
Output results in JSON format
--parallel
Run files concurrently
--retry num
Number of retry attempts on failure
--delay ms
Pause before each request
--variable name=value
Define a template variable
--variables-file file
Load variables from a file
--secret name=value
Define a redacted variable (hidden from logs)
-o, --output file
Write response body to file
-k, --insecure
Allow insecure SSL connections
--verbose
Enable detailed logging
--very-verbose
Enable extra-detailed logging including request/response bodies
--continue-on-error
Proceed despite assertion failures
--from-entry num
Start execution at a specific entry
--to-entry num
Stop execution at a specific entry

CAVEATS

Hurl files use a custom format that is not compatible with curl command syntax despite the shared libcurl backend. The plain text format requires learning Hurl's specific syntax for assertions and captures. Error messages for malformed .hurl files can be cryptic.

HISTORY

hurl was created by Orange-OpenSource (the French telecommunications company) and first released on GitHub in August 2020. Written in Rust with libcurl as its HTTP engine, it has grown to over 18,000 GitHub stars and is actively maintained.

SEE ALSO

curl(1), wget(1), httpie(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community