返回

curl

进行 HTTP(S) 请求与文件下载。

用途:命令行发起 HTTP 请求、下载文件、调试接口。

语法:

curl [选项] URL

常见用法:

# 下载
curl -O https://example.com/file.tar.gz

# 跟随重定向并保存
curl -L -o out.html https://example.com

# 只看响应头
curl -I https://example.com

# POST JSON
curl -X POST -H 'Content-Type: application/json' -d '{"name":"Alice"}' https://httpbin.org/post