Curl Cookbook
catonmat.net
catonmat.net
wwwinfo()
{
printf "##\n# PAGE INFO\n##\n"
curl \
--silent \
--output /dev/null \
--user-agent 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36' \
--write-out \
" Remote IP: %{remote_ip}
Port: %{remote_port}
Name Lookup: %{time_namelookup}s
Connect Time: %{time_connect}s
TLS Handshake: %{time_appconnect}s
Total Time: %{time_total}s
Down Speed: %{speed_download}B/s\n" \
"$1" &&\
printf "##\n# HEADERS\n##\n"
curl --head "$1"
}
(It spoofs Chrome latest + Windows 10 user-agent, but this is optional.)curl http://example.com --libcurl example.c
> curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP).
Also, the manpage says:
> curl is powered by libcurl for all transfer-related features.
So, that means you get the same benefit when using libcurl from other programming languages.
scp -T server:'$(ls -t * | head -1)' .I had looked it up with precisely those keywords[1] and nothing that seemed like scp was deprecated came up. However, I admit I didn't use Google.
Also, it wasn't a statement of doubt as much as it was a request for information and an expression of frustration in case it was true. Thank you for answering, by the way.
I even filed a feature request to support different authorization/authentication (e.g. shared inboxes accessed through a regular user account), and one of the contributor implemented it. Had a great experience :)
Also the '-d <param> -G' combo to do query strings surprised me. I've always just submitted the full url, maybe with a quick grumble when I forget to single quote it all. I actually don't see much of an advantage here, since you still need to quote the parameters, and it keeps the same format.
For example, direct a request to a specific server in a cluster. Or send to localhost SSL without -k, so you can still test certificate verification works ( localhost can be useful, because some dumb firewalls block 'external' non-443 SSL).