curl基本使用
发布: 2019-12-16 23:30:02标签: linux
curl基本使用
curl: 发送get请求
复制代码01curl https://www.example.com-A/H: 指定 User-Agent
复制代码01curl -A 'Mozilla/5.0 ' https://test.com-b: 发送cookie
复制代码01curl -b 'foo=bar' https://test.com-c: 保存服务器设置cookie到文件
复制代码01curl -c cookie.txt https://test.com-d: 发送post请求的数据体(后可以跟文件)
复制代码01# header会自动Content-Type : application/x-www-form-urlencoded02cul -d 'username=aa&password=bb' -X post https://test.com-e: 设置头部Referer, 请求来源
复制代码01curl -e 'https://test.com' https://test.com-F: 发送二进制文件
复制代码01curl -F 'file=**.psd' https://test.com-G: URL上的params
复制代码01curl -G -d 'a=1' -d 'b=2' https://test.com-i: 打印服务端回应HTTP头
复制代码01curl -i https://test.com-I: 向服务器发出 HEAD 请求,然会将服务器返回的 HTTP 标头打印出来
复制代码01curl -I https://test.com-k: 跳过SSL检测
复制代码01curl -k https://test.com-L: 跟随重定向
复制代码01curl -L https://test.com---limit-rate: 限制带宽
复制代码01curl --limit-rate 10k https://test.com-o: 保存服务器回应的文件
复制代码01curl -o test.txt https://test.com-O: 保存服务器文件,使用最后斜线后作为名字
复制代码01curl -O https://test.com-s: 不输出错误信息
-u: 用户密码认证
复制代码01curl -u 'username:aaa' https://test.com-v: 输出通信的过程
复制代码01curl -v https://test.com-x: 指定http代理
复制代码01curl -x proxy.com https://test.com-X: 指定请求方法
复制代码01curl -X post https://test.com