cURL Notes
curl -c cookie.txt URL
: save cookies to cookie.txtcurl -b cookie.txt URL
: read cookie from cookie.txt and put into requestcurl -H 'User-Agent: FakeUA' URL
: set HTTP headercurl -I URL
: show header onlycurl -L URL
: follow 30x redirectcurl -o new_name/-O URL
: save response to filecurl -X POST --data "data=xxx" URL
: POST data to URLcurl -w "@curl-format.txt" URL
: format details of request, which you can use this to timing request:
➜ cat curl-format.txt
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
➜ curl -w "@curl-format.txt" -o /dev/null -s https://fann.im
time_namelookup: 0.015
time_connect: 0.015
time_appconnect: 0.329
time_redirect: 0.000
time_pretransfer: 0.329
time_starttransfer: 0.377
----------
time_total: 0.377
Was this page helpful?