For a RESTful HTTP POST containing XML:
curl -X POST -d @filename.txt examplewebsite/path/to/resource --header "Content-Type:text/xml"
or for JSON, use this:
curl -X POST -d @filename.txt examplewebsite/path/to/resource --header "Content-Type:application/json"
This will read the contents of the file named filename.txt and send it as the post request.