Overview
curl is a command-line tool for transferring data using URLs. It comes preinstalled on almost every modern system.
Common Commands
# GET request
curl https://example.com
# Show response headers only
curl -I https://example.com
# POST JSON data
curl -X POST https://api.example.com/login \
-H "Content-Type: application/json" \
-d '{"user":"admin","pass":"123456"}'
# Download a file and save it
curl -o file.tar.gz https://example.com/file.tar.gz
# Follow redirects
curl -L http://example.com
Windows Usage
After extracting the zip file, either add the directory containing curl.exe to your system PATH, or run it directly from the extracted folder:
# In PowerShell, use curl.exe to avoid conflicting with the Invoke-WebRequest alias
curl.exe https://example.com
Linux Installation
# Debian/Ubuntu
sudo apt install curl
# RHEL/CentOS
sudo yum install curl