User Tools

Site Tools


This is an old revision of the document!

Quickly Send a 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 "<?xml version="1.0"?>...."

I use this method for testing almost every day. Saves a lot of time.

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.

You can also pipe the resulting page to vim, using:

curl | vim -


curl -i | vim -

to also view the headers.

tips/linux/httppost.1244476040.txt.gz · Last modified: 2012/06/02 06:09 (external edit)