I currently have a database set up on a RaspPi, on which I have a table called "temphum1". I want to send data to this table by using a GET request with the data inserted into the URL with cURL within a Process command.
Here is the two options I'm working on:
Process p;
p.begin("curl");
p.addParameter(" -X");
p.addParameter(" GET");
p.addParameter(" -g");
p.addParameter(" http://192.168.1.12/temphum1/put_data.php?reading=");
p.addParameter("2014-08-03");
p.addParameter("%2c");
p.addParameter(String(h));
p.addParameter("%2c");
p.addParameter(String(t));
p.addParameter("%2c");
p.run();
while(p.running());
and this:
p.runShellCommand("curl -X GET -g http://192.168.1.12/temphum1/put_data.php?reading=2014-08-03%2c"+String(h)+"%2c"+String(t)+"%2c");
The "%2c" is the separator for the data, and the "h" and "t" variables are floats. To me, using "String(h)" and "String(t)" doesn't give any errors while compiling, but I still don't know if that will work. Plus I'm relatively new to cURL and Process.
Thanks for your time,
Tiharo