%{variable name}
HTTP 请求的 Content-type
错误信息
转移的数字出口代码,不知道啥来的
curl 执行结果最终写入的文件名,当加上了 -o、-O 才有意义
初始路径,当登录到远程 FTP 服务器时结束
响应码
在对 curl CONNECT 请求的最后响应(来自代理)中找到的数字代码
http 版本
ip 地址,可以是ipv4,也可以是ipv6
最近传输中,新的连接数
在请求中跳转的次数
当 curl 没有指定 -L、--location 参数跟随重定向时,此变量将显示重定向实将跳转的实际 URL
目标服务器的远程IP,可以是 ipv4、ipv6
目标服务器的远程端口
和 http_code 一样,都是响应码
请求协议,就是 HTTP、HTTPS
下载的总字节数
下载头的总字节数
HTTP请求中发送的总字节数
上传的总字节数
平均下载速度,每秒字节数
平均上传速度,每秒字节数
DNS 域名解析的耗时,就是把 https://zhihu.com
转换成 ip 地址的过程
TCP 连接建立的时间,就是三次握手的时间
SSL/SSH 等上层协议建立连接的时间,比如 connect/handshake 的时间
从请求开始到响应开始传输的时间
这次请求花费的全部时间
某个请求的响应特别慢,那想要分析为什么这个请求慢,到底是哪一步耗时长,应该怎么做?
提供了 7 种 time 变量,上面就能看到
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_redirect: %{time_redirect}\n
time_pretransfer: %{time_pretransfer}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}
curl -w "@format.txt" -S -s -L -k -o /dev/null http://baidu.com
所有时间都是秒单位
因为不是 https 协议和重定向,所以中间两个没有时间
curl -w "@format.txt" -S -s -L -k -o /dev/null https://baidu.com
SSL 协议处理时间:time_appconnect【0.042989】 - time_namelookup【 0.008223】