Hurl

Hurl

WHAT IS IT?

Hurl is a command-line tool that runs HTTP requests defined in a simple, readable text format. Where curl stops at executing requests, Hurl adds a complete layer of assertions and chaining that makes it a formidable HTTP testing tool.

WHY IS IT INTERESTING?

  • Readable text format: .hurl files are easy to read, write, and version in Git
  • Built-in assertions: Check status codes, headers, body, JSONPath, XPath directly
  • Request chaining: Capture values from a response to reuse in the next one
  • CI/CD ready: JSON output, HTML reports, actionable return codes
  • Performance: Written in Rust, fast execution even on large test suites

QUICK EXAMPLE

# Test an API endpoint
GET https://api.example.com/users
HTTP 200
[Asserts]
header "Content-Type" contains "json"
jsonpath "$.users" count > 0

# Create a user and verify the response
POST https://api.example.com/users
{
    "name": "z29k",
    "role": "admin"
}
HTTP 201
[Captures]
user_id: jsonpath "$.id"

# Use the captured ID
GET https://api.example.com/users/{{user_id}}
HTTP 200
[Asserts]
jsonpath "$.name" == "z29k"

USE CASES

  • REST/GraphQL API integration tests
  • Smoke tests in CI/CD
  • Living documentation for endpoints
  • Versionable replacement for Postman collections
  • HTTP regression tests

INSTALLATION

# macOS
brew install hurl

# Cargo
cargo install hurl

# Docker
docker run --rm -v /tmp:/tmp ghcr.io/nickel-org/hurl:latest

VERDICT

Hurl fills the gap between curl (too basic for testing) and full suites like Postman (too heavy). Its text format makes it a first-class citizen in a Git workflow. Essential for any backend developer.