CURL命令在线生成

目标地址
请求地址
编码方式
ContenType
Select
请求参数
CURL命令
介绍
cURL命令在线生成

什么是CURL

cURL 是一个利用URL语法在命令行下工作的文件传输工具,1997年首次发行。它支持文件的上传和下载,所以是综合传输工具,但按传统,习惯称 cURL 为下载工具。cURL 支持很多协议,如HTTP、HTTPS、FTP、FTPS、TFTP、SFTP、Gopher、SCP、Telnet、LDAP、DICT、POP3、IMAP、SMTP等。

它用命令行的形式来发送请求,请求WEB服务器。名称是客户端(client)的 URL 工具的意思。

参数说明

命令描述例子
-A指定客户端的用户代理标头,即 User-Agent。curl -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36' https://www.tol.vip
-b向服务器发送 Cookie。curl -b 'foo1=bar' -b 'foo2=baz' https://www.tol.vip
-c将服务器设置的 Cookie 写入一个文件。curl -c cookies.txt https://www.google.com
-d用于发送 POST 请求的数据体。curl -d 'login=emma&password=123' -X POST https://www.tol.vip
--data-urlencode发送 POST 请求的数据体,自动进行 URL 编码。curl --data-urlencode 'comment=hello world' https://www.tol.vip
-e设置 HTTP 的标头 Referer,表示请求的来源。curl -e 'https://www.tol.vip?q=example' https://www.tol.vip
-F向服务器上传二进制文件。curl -F 'file=@photo.png;type=image/png;filename=me.png' https://www.tol.vip/profile
-G构造 URL 的查询字符串。curl -G -d 'q=kitties' -d 'count=20' https://www.tol.vip/search
-H添加 HTTP 请求的标头。curl -H 'Accept-Language: en-US' https://www.tol.vip
-i打印出服务器回应的 HTTP 标头。curl -i https://www.tol.vip
-k跳过 SSL 检测。curl -k https://www.tol.vip
-LHTTP 请求跟随服务器的重定向。curl -L -d 'tweet=hi' https://api.twitter.com/tweet
--limit-rate限制 HTTP 请求和回应的带宽。curl --limit-rate 200k https://www.tol.vip
-s不输出错误和进度信息。curl -s https://www.tol.vip
-u设置服务器认证的用户名和密码。curl -u 'zhangsan:123456' https://www.tol.vip
-v输出通信的整个过程,用于调试。curl -v https://www.tol.vip
--trace输出通信的整个过程,并显示原始的二进制数据。curl --trace - https://www.tol.vip
-x指定 HTTP 请求的代理。curl -x socks5://james:cats@myproxy.com:8080 https://www.tol.vip

常用命令

  • 获取网页内容:
    curl https://example.com
  • 下载文件:
    curl -O https://example.com/file.txt
  • 发送 POST 请求:
    curl -d 'param1=value1¶m2=value2' -X POST https://example.com/api
  • 上传文件:
    curl -F 'file=@localfile.txt' https://example.com/upload
  • 使用代理访问网页:
    curl -x proxy.example.com:8080 https://example.com
  • 发送 JSON 数据:
    curl -d '{"key": "value"}' -H 'Content-Type: application/json' https://example.com/api
  • 设置用户代理:
    curl -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36' https://example.com
  • 发送自定义请求头:
    curl -H 'Authorization: Bearer token123' https://example.com/api
  • 跟随重定向:
    curl -L https://example.com/redirect
  • 限制下载速度:
    curl --limit-rate 200k https://example.com/largefile.zip
域名whois查询
[开发类]

快速获取域名注册信息

JWT加解密工具
[开发类]

解析或者生成JWT字符串的工具

ip转int
[开发类]

IP地址转换为整数

随机头像获取
[开发类]

随机生成网络头像

键盘按键码
[开发类]

获取键盘按键码(KeyCode)

URL编码
[开发类]

在线编码解码URL