Skip to content

Instantly share code, notes, and snippets.

@1901
Created November 20, 2018 12:37
Show Gist options
  • Save 1901/777ab7c9ab9f93fe0f827b228b7bb149 to your computer and use it in GitHub Desktop.
Save 1901/777ab7c9ab9f93fe0f827b228b7bb149 to your computer and use it in GitHub Desktop.
[curl] #linux #curl #network
# 使用指定的 Host 访问某个地址
curl -w "@curl_format.txt" -H 'Host: www.baidu.com' 'http://127.0.0.1'
# 用于分析请求耗时
curl -w "@curl_format.txt" 'http://127.0.0.1'
# 设置超时
curl --connect-timeout 1 --max-time 3 "http://www.baidu.com"
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}\n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment