« Home | Agave Mountain, Inc. Privacy Policy » | Cleaning up a "new" PC » | Tax Issues for Nomadic Consultants » | Google Docs adds PowerPoint » | C++: Pragmatically Generating a Back Trace/Stack D... » | Paperless Office - Scan Forward » | Paperless Office for Small Offices » | Ameritrade » | Installation of Xilinx ISE/EDK for Redhat 4.0 » | TD Ameritrade Hacked. »

HTTP GET, POST, and PUT with curl

Curl is one of those swiss army knife type command line utilities for developers who need to develop web services or network software. I keep forgetting the command line syntax using curl, so I thought I would post it here in its artful simplicity.

HTTP GET to a URL:

curl http://www.domain.com/index.html

HTTP PUT a file to a URL:


curl -X -d @mytestfile.xml http://www.domain.com/script.php

HTTP POST a string to a URL:

curl -d "String to post" http://www.domain.com/script.php

HTTP POST a file to a URL:

curl -d @file_to_post.xml http://www.domain.com/script.php

Enjoy.

Mis-posted by ScribeFire and corrected by hand.

Labels: