Im using curl against a webapi which knows to return a file for a particular post request (running this within browser would trigger the browser to pop up a "save file" dialog) . My intention is to have the response bytes written to a file. I use the following command
curl -k -i -u username:password -X POST -H "Content-Type:application/json" -d @c:\\curl\\request_body_file.json -o config.cfg https://127.0.0.1:8000/myapi/trigger/export
This however causes also the response header to be written to the output file, which is not my desire. I only need the response content saved.
This is how the output file looks like :
TTP/1.1 200 OK
Content-Length: 12042
Content-Type: application/octet-stream; charset=UTF-8
Content-Disposition: attachment; filename=my_export
Date: Wed, 23 Oct 2013 09:30:47 GMT
Accept-Ranges: bytes
Server: Restlet-Framework/2.1.2
X-Auth-Token: Token ODVhMzk3OWY1NjcwMjg2ZGM0MDhmNTEzYTYwZmE4M2JhNTM1YmE0Yw==
xÚíÝÛãX~ØqÍÎŽçvfvervrevtrbyewd3334444 ................................
How would the curl command look in order to achive what I previously described.
Thanks