Install Hurl on Ubuntu 24.04

Install Hurl on Ubuntu 24.04

Hurl is a command line tool used to run and test HTTP requests. It is particularly useful for developers and testers who need to interact with web services and APIs. Hurl allows users to define HTTP requests in plain text files, making it easy to script and automate tests for various endpoints. This tutorial explains how to install Hurl on Ubuntu 24.04.

Install Hurl

Get the latest Hurl version directly from its GitHub repository:

HURL_VERSION=$(curl -s "https://api.github.com/repos/Orange-OpenSource/hurl/releases/latest" | grep -Po '"tag_name": "\K[0-9.]+')

Download Hurl with the specified version:

wget -qO hurl.tar.gz https://github.com/Orange-OpenSource/hurl/releases/latest/download/hurl-$HURL_VERSION-x86_64-unknown-linux-gnu.tar.gz

Create temporary directory and extract files to it:

mkdir hurl-temp
tar xf hurl.tar.gz --strip-components=1 -C hurl-temp

Move executable to /usr/local/bin:

sudo mv hurl-temp/bin/hurl /usr/local/bin

Execute the command to check the Hurl version:

hurl --version

Remove no longer needed file and temporary directory:

rm -rf hurl.tar.gz hurl-temp

Testing Hurl

Create a file named test.hurl that contains a simple HTTP GET request:

echo 'GET https://httpbin.org/get' > test.hurl

Run the following command:

hurl test.hurl

It executes the HTTP GET request to the specified URL defined in the file. Output example:

{
  "args": {}, 
  "headers": {
    "Accept": "*/*", 
    "Host": "httpbin.org", 
    "User-Agent": "hurl/4.3.0", 
    "X-Amzn-Trace-Id": "Root=1-6416c45e-47a4828a557d5fca764271d6"
  },
  "origin": "XXX.XXX.XXX.XXX", 
  "url": "https://httpbin.org/get"
}

Uninstall Hurl

To completely remove Hurl, delete related file:

sudo rm -rf /usr/local/bin/hurl

Leave a Comment

Cancel reply

Your email address will not be published.