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

相关文章:

  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-08-18
  • 2021-07-01
  • 2022-01-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2021-10-30
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案