How to send data using curl from Linux command line? How to send data using curl from Linux command line? curl curl

How to send data using curl from Linux command line?


If it is only (key,value) pairs that you want to send then

curl -d key1=value1 -d key2=value2 <URL>

But if it is some file that you want to send then

curl --data-binary @<file path> <URL>


there is a "--post-file" option in wget:

wget --post-file=filetoSend URL


this is a get: curl "http://www.google.com/?hl=en&q=search"

for a post you have to use the option "-d" and specify the key=value variables