Curl命令查看请求响应时间

Curl命令查看请求响应时间

1、vim curl

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

Leave a Reply

Your email address will not be published. Required fields are marked *