Several frequently used GET and POST commands in curl are listed here.
GET commands:
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://tecbar.net/demo/param
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://tecbar.net/demo/param
POST commands
POST data
curl --data "param1=value1¶m2=value2" http://tecbar.net/demo/param
SOAP request (POST)
curl -H "Content-Type: application/xml" --data "
POST data from a file
curl -H "Content-Type: application/xml" --data "@req.xml" http://tecbar.net/demo/param
File upload
curl --form "fileupload=@filename.txt" http://hostname/resource
RESTful HTTP POST
curl -X POST -d @filename http://tecbar.net/demo/param
Logging into a site (auth)
curl -d "username=admin&password=admin&submit=Login" --dump-header headers http://myhost/login
curl -L -b headers http://myhost/
Excellent