Here's a way to suppress all curl output and headers, with the option of still showing errors if they occur. Useful for cron jobs or automated testing.
Unix
To suppress all output:
curl --silent --output /dev/null http://example.com
To suppress output but still show errors if they occur:
curl --silent --output /dev/null --show-error --fail http://example.com
Windows
To suppress all output:
curl --silent --output nul http://example.com
To suppress output but still show errors if they occur:
curl --silent --output nul --show-error --fail http://example.com
Parameters Explained
--silent
suppresses the download-in-progress stats (but will still show HTML output)
--output /dev/null
hides successful output
--show-error
shows errors, even when silent
mode is enabled
--fail
will raise an error if HTTP response is an error code (404, 500 etc.) instead of merely DNS/TCP errors.
UPDATE: I realise the original author wanted to inspect the headers and response code of a request rather than silencing everything. See samael's answer for details on how to do that.