1、vim curl
\n
time_namelookup: %{time_namelookup}\n time_connect: %{time_connect}\n time_appconnect: %{time_appconnect}\n time_pretransfer: %{time_pretransfer}\n time_redirect: %{time_redirect}\n time_starttransfer: %{time_starttransfer}\n ----------\n time_total: %{time_total}\n \n
time_namelookup:DNS解析域名時間,把域名--->ipd的時間
time_connect:TCP連接的時間,三次握手的時間
time_appconnect:SSL|SSH等上層連接建立的時間
time_pretransfer:從請求開始到到響應開始傳輸的時間
time_redirect:從開始到最后一個請求事務的時間
time_starttransfer:從請求開始到第一個字節將要傳輸的時間
time_total:總時間
2、eg
curl -w "@curl" -o /dev/null -s -d "username=aaa&password=bbb" https://xxx.xxx.com/webapp/xxx/login
-w:從文件中讀取信息打印格式
-o:輸出的全部信息
-s:不打印進度條
-d:參數
3、簡單的方式
curl -o /dev/null -s -w '%{time_connect}:%{time_starttransfer}:%{time_total}\n' 'http://www.baidu.com'
忽略ssl認證 並輸出結果
curl -k -XPOST -w '\n%{time_connect}:%{time_starttransfer}:%{time_total}\n' www.baidu.com
4、當Content-Type:application/json,requestBody:{id: 93, status: 2}
curl -w "@curl" -H "Content-Type:application/json" -X PUT --data '{id: 93, status: 2}' http:/xxxxxxxxxxx/changeStatus