curl 是一个功能非常强大的开源软件,支持FTP,HTTP,HTTPS,Telnet等多种协议。对于运维、开发同学来说,它是工作中不可缺少的排障利器。它的基本使用姿势请参考文档https://cloud.tencent.com/developer/article/1419809
今天主要给大家介绍curl 的高级使用姿势:
[root@cdntest home]# curl -w "@curl-format" -o /dev/null -sL "http://cloud.tencent.com/"
time_namelookup: 0.004
time_connect: 0.037
time_appconnect: 0.144
time_pretransfer: 0.144
time_redirect: 0.124
time_starttransfer: 0.222
--------------------------
time_total: 0.545
http_code: 200
------------------
size_download: 348734
speed_download: 639889.000
size_header: 692
size_request: 162
size_upload: 0
speed_upload: 0.000
curl-format 内容如下:
[root@cdntest home]# more curl-format
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
http_code: %{http_code}\n
------------------\n
size_download: %{size_download}\n
speed_download: %{speed_download}\n
size_header: %{size_header}\n
size_request: %{size_request}\n
size_upload: %{size_upload}\n
speed_upload: %{speed_upload}\n
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。