Curl post data and headers only

The -I option tells curl to do a HEAD request while the -d'test=test' option tells curl to do a POST, so you’re telling curl to do two different request types.

curl -s -d'test=test' -D- -o/dev/null www.google.com 

or, on Windows:

curl -s -d'test=test' -D- -onul: www.google.com 

That is the neatest way to do this as far as I can find. The options are:

  • -D- Dump the header to the file listed, or stdout when - is passed, like this.
  • -o/dev/null Send the body to the file listed. Here, we discard the body so we only see the headers.
  • -s Silent (no progress bar)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)