Skip to content

Instantly share code, notes, and snippets.

@finas
Forked from 1901/curl.sh
Created June 21, 2021 12:55
Show Gist options
  • Save finas/3c21459930572ca43cdbfa59d7f059c8 to your computer and use it in GitHub Desktop.
Save finas/3c21459930572ca43cdbfa59d7f059c8 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