curl -X "POST"或者"GET" 设置请求方式
curl -b /test/cookie.txt 接接口地址 请求之前需要鉴权cookie
curl -x 192.168.0.1:10086 http://www.baidu.com curl支持通过内置option:-x支持设置代理
curl -c cookie.txt http://www.baidu.com 获取请求之后的cookie信息 写到cookie.txt 可以指定路径
curl -D cookied.txt http://www.baidu.com 获取请求之后的headers信息 写到cookied.txt 可以指定路径
curl -T test.JPG -u 用户名:密码 ftp://www.baidu.com/img/ 上传文件
curl -f http://www.baidu.com/error 显示抓取错误
curl -w http://www.baidu.com 完成后输出什么
curl -O http://www.baidu.com/test.sh 指定test.sh 文件内容为请求参数
curl -o /dev/null -s -w %{http_code} www.baidu.com 显示网页返回状态码,200表示成功。
curl -x 192.168.0.1:10086 http://www.baidu.com curl支持通过内置option:-x支持设置代理
curl -A "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.0)" http://www.baidu.com 这样服务器端就会认为是使用IE8.0去访问的。
curl -O http://www.baidu.com/tieba1.JPG 使用内置option:-O下载 下载文件