Skip to content

Hurl for Curl

Heath Brown edited this page Sep 7, 2024 · 6 revisions

Hurl

Windows Installation

winget install hurl

Cargo Install

cargo install hurl

Basic command

hurl test.hurl 

hurl test.hurl —-test

Hurl File

Basic Example with 'test'

This checks that there is a 200 returned

#test.hurl
GET http://httpbin.org
HTTP 200

Authentication with headers

adds in authentication via HTTP headers

#test-auth.hurl
GET http://httpbing.org
X-HTTP-API-USER: user
X-HTTP-API-TOKEN: token

Basic auth

GET http://httpbing.org
[BasicAuth]
bob: secret

Using variables for sensitive items

hurl ./ --variable user=user token=token
hurl ./ --variables-file hurl.env

export HURL_user=user
export HURL_token=token
#hurl.evn
user=user
token=token
#test-auth.hurl
GET http://httpbing.org
X-HTTP-API-USER: {{user}}
X-HTTP-API-TOKEN: {{token}}
GET http://httpbing.org
[BasicAuth]
{{user}}: {{secret}}
 
# Resources
- [Hurl](https://hurl.dev/#whats-hurl)
Clone this wiki locally