Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send data using curl from Linux command line?

I am trying to transmit data out of an embedded Linux device over the wifi connection. I have curl and wget on the device. How would I transmit data out of the device using curl or wget ? Any pointers welcome.

like image 909
Ankur Agarwal Avatar asked Jul 28 '11 20:07

Ankur Agarwal


2 Answers

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>
like image 87
Satyajit Avatar answered Oct 28 '22 09:10

Satyajit


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

wget --post-file=filetoSend URL
like image 39
Michał Šrajer Avatar answered Oct 28 '22 10:10

Michał Šrajer