A better way to view only the header of a response is using the flags -o to redirect the body and -D to redirect the header of the response. When I want to print only the header to stdout I do
curl -o/dev/null -D- http://www.example.com
-I does not work with methods other than GET. This does the job.