可以用来测试网站能否正常访问、网站URL响应什么状态码、网站响应文本内容、连接接口的请求时间等curl -v http://httpbin.org/get
curl --connect-timeout 5 -x 58.118.19.119:8011 http://httpbin.org/get
新建curl-format.txt文件,文件内容如下

\n
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_starttransfer: %{time_starttransfer}\n
time_redirect: %{time_redirect}\n
time_total: %{time_total}\n
\n
curl输出的时间含义,其中time_total代表整个请求所消耗的时间
time_namelookup:dns解析总共消耗的时间
time_connect:从开始dns解析到tcp建联成功之间总共消耗的时间
time_appconnect:从开始dns解析到ssl握手成功之间总共消耗的时间,以收到Finished包为准。
time_pretransfer:从开始dns解析到发起http请求之间总共消耗的时间
time_starttransfer:从开始dns请求到服务器响应首个字节之间总共消耗的时间
time_total:整个请求所消耗的时间,包含dns解析、tcp握手和ssl握手的时间
然后在当前curl-format.txt文件所在路径下,输入命令curl -w "@curl-format.txt" http://httpbin.org/get

curl -o resp.html http://httpbin.org/get
curl http://11.120.12.89:6666/sengMsg -X POST -d "parameterName1=parameterValue1¶meterName2=parameterValue2"
curl http://11.120.12.89:6666/sengMsg -X POST -H "Content-Type:application/json" -d '{"parameterName1":"parameterValue1","parameterName2":"parameterValue2"}'
更多参考文档:更多介绍参考文档