A Much simpler and easier approach is to use:
curl -X HEAD -I http://www.google.com Order can be changed for example:
curl http://www.google.com -X HEAD -I This is useful if you are grabbing curl request from chrome inspector.
Note: Some incorrectly configured/programmed web servers might response different then the post because it is a HEAD request not POST. But works most of the time