Erik's Weblog 2.0

February 1, 2006


Quick HTTP POST request

Have you ever wanted to quickly send a POST request to a HTTP server? It's pretty easy to do using curl.

For example to send XML via a POST request, you could use the following:
curl --header "Content-Type: text/xml" --data "...."
I use this method for testing almost every day. Saves a lot time.

There's a tip entry in the wiki too.

Another curl command I use often is:
curl -I
to get a HEAD request.


curl --header "Accept-Encoding: gzip" | gunzip
to get the compressed request.