curl 常用命令
1、post请求
curl -d ‘data’ ‘url’
2、get请求
curl -G ‘url’
curl -i ‘url’
3、设置cookie
curl -d ‘data’ ‘url’ --cookie ‘key:value’
curl -G ‘url’ --cookie ‘key:value’
curl -i ‘url’ --cookie ‘key:value’
4、下载
curl -o test.pdf https://XXXX/test.pdf
下载多个
curl -o test.pdf https:/xxx/test.pdf -o test1.pdf https://xxx/test1.pdf
data格式为 key=value&key=value
注意空格和单引号,有些url没有单引号会找不到请求
本文详细介绍了curl命令的各种使用方法,包括GET和POST请求、设置Cookie、文件下载等操作,并提供了具体的命令示例。
2110

被折叠的 条评论
为什么被折叠?



