Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between curl calls

Tags:

linux

curl

What is the difference between this two curl calls:

curl -X POST -d "/path/file.txt" http://api-path
curl -X POST -d "@/path/file.txt" http://api-path

like image 688
crsuarezf Avatar asked Jan 21 '26 05:01

crsuarezf


1 Answers

The first form sends the string "/path/file.txt" as data, probably not what you want. The @ makes curl interpret it as a filename to read from. See http://curl.haxx.se/docs/manpage.html, search for the "--data" option.

like image 54
C. Ramseyer Avatar answered Jan 23 '26 20:01

C. Ramseyer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!