headcurl.cmd (windows version)
curl -sSkv -o NUL %* 2>&1 - I don't want a progress bar
-s, - but I do want errors
-S, - not bothering about valid https certificates
-k, - getting high verbosity
-v(this is about troubleshooting, is it?), - no output (in a clean way).
- oh, and I want to forward stderr to stdout, so I can grep against the whole thing (since most or all output comes in stderr)
%*means [pass on all parameters to this script] (well(https://stackoverflow.com/a/980372/444255), well usually that's just one parameter: the url you are testing
real world-world example (on troubleshooting proxy issues):
C:\depot>headcurl google.ch | grep -i -e http -e cache Hostname was NOT found in DNS cache GET HTTP://google.ch/ HTTP/1.1 HTTP/1.1 301 Moved Permanently Location: http://www.google.ch/ Cache-Control: public, max-age=2592000 X-Cache: HIT from company.somewhere.ch X-Cache-Lookup: HIT from company.somewhere.ch:1234 Linux version
for your .bash_aliases / .bash_rc:
alias headcurl='curl -sSkv -o /dev/null $@ 2>&1'