Dev Toolkit中文

curl

A powerful command-line tool for transferring data with URLs, supporting dozens of protocols including HTTP/HTTPS/FTP. Essential for API debugging.

Tags:linuxwindowsnetworkcliOfficial site ↗

Release notes:Fixes a regression introduced in 8.10.0.

Usage Guide

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