http post with command line curl

Written by
Date: 2012-05-26 18:17:00 00:00


I needed to perform a post request with curl from the Mac command line.

Here is how I did it:

curl -d "post data" http://example.com/file

You can send a complete file using the @ symbol.

curld --data @file-to-send http://example.com/file

Use, --data-urlencode to send url enconded data.