安装包含本地参考和全部已发布模式的完整包。
install curlcurl当你需要知道远程端点从服务器侧实际如何响应时使用
curl <url|host|me> [options]curl me使用当前主机
curl example.com发送 GET 请求并显示状态和正文
curl example.com -I仅显示最终响应头
curl example.com -s [file]保存响应;省略名称时使用 URL 文件名
curl example.com -X POST -d "a=1"发送请求正文
-X <method>设置 HTTP 方法
-d <data>设置请求正文;默认 POST
-H "Name: value"添加请求头;可重复指定
-u <user>通过隐藏密码输入使用 HTTP Basic 身份验证
-c '{"name":"value"}'从 JSON 对象发送 cookie
-s [file] | -o <file>将响应保存到主机
-a追加而非替换;需要 -s 或 -o
-i包含最终响应头
-I仅显示最终响应头
-j以结构化 JSON 显示响应
-edit @edit在文本编辑器中打开响应正文
-code @code在代码编辑器中打开响应正文
-t [seconds]使用 5 秒或 1 到 300 秒的自定义超时
-T使用 300 秒超时
-4 | -6在
-r不跟随重定向
-k允许不安全的 TLS 证书
可直接在页面中运行预先准备的示例。结果已预先生成并在浏览器中显示;服务器不会执行任何终端命令。
安装当前兼容版本。完整功能请选择 Base,精简包请选择 Minimum;已安装模块的更新请使用 upgrade。
Base 与 Minimum 是同一当前模块版本的两个包。
安装包含本地参考和全部已发布模式的完整包。
install curl安装精简包。该包不包含本地参考;
install curl -m安装这个确切的已发布版本。
install curl -v 1.2.4让 upgrade 检查兼容性,仅在需要时替换已安装块。
upgrade curl删除扩展块,不影响核心和其他模块。
install curl -u示例可复制,但网站不会执行。请先检查路径、权限和破坏性选项。
curl https://example.com -I | curl https://example.com/feed.xml -o sandbox/tmp/feed-copy.xmlHTTP/2 200
content-type: text/html; charset=UTF-8
content-length: 1256
sandbox/tmp/
feed-copy.xmlcurl https://example.comHTTP 200
URL https://example.com/
<!doctype html>
<html>
<head><title>Example Domain</title></head>
<body>…</body>
</html>curl https://example.com -IHTTP/2 200
content-type: text/html; charset=UTF-8
cache-control: max-age=86000
content-length: 1256curl https://example.com -iHTTP/2 200
content-type: text/html; charset=UTF-8
<!doctype html>
<html>…</html>curl https://example.com/api -H "Accept: application/json"HTTP 200
URL https://example.com/api
{"status":"ok","service":"example"}curl https://example.com/api -X POST -d "name=lil"HTTP 200
URL https://example.com/api
{"saved":true,"name":"lil"}curl https://example.com -c '{"theme":"dark"}'HTTP 200
URL https://example.com/
<!doctype html>
<html data-theme="dark">…</html>curl https://example.com/feed.xml -o sandbox/tmp/feed.xmlsandbox/tmp/
feed.xmlcurl meHTTP 200
URL https://lil.dog/
<!doctype html>
<html>…</html>curl https://example.com -6HTTP 200
URL https://example.com/
<!doctype html>
<html>…</html>curl https://example.com -rHTTP 200
URL https://example.com/
<!doctype html>
<html>…</html>curl https://example.com -4HTTP/2 200
content-type: application/json
content-length: 128curl ftp://example.comURL无效