Wednesday, June 29, 2005

HTTP POST with curl


I keep forgetting how to perform a HTTP POST with curl, so I want to write this down so I don't forget.


Posting a string:


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


Posting the contents of a file


curl -d @file_to_post.txt "http://www.domain.com/file.php"