curl
欢迎访问新站点: https://www.yidiankuaile.com/post/curl
命令参数
显示输出内容
1  | curl http://example.com  | 
-i 输出响应头信息和内容
1  | curl -i http://example.com  | 
--head -I 输出响应头信息
1  | curl --head http://example.com  | 
-o 输出内容到文件,另存为
1  | curl http://example.com/hello.txt -o hello.txt  | 
-O 输出内容到文件,保持原文件名
1  | curl -o http://example.com /hello.txt  | 
-d post请求中的data
post请求
1  | curl -d "title=hello&&body=hello world" http://  | 
-X 设置请求方式
put请求
1  | curl -X put -d "title=hello&&body=hello world" http://  | 
-L  跟踪跳转(Follow redirects)
1  | curl http://google.com  | 
-u 上传
1  | curl -u user@example.com:123456 -T hello.txt ftp://ftp.expample.com  | 
下载
1  | curl -u user@example.com:123456 -o hello.txt ftp://ftp.expample.com/hello.txt  | 
更新记录
- 2017-05-09 首次发布