Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface TMP175 mbed-rtos mbed
Fork of HTTP_POST by
Revision 14:a93858b247b9, committed 2016-04-15
- Comitter:
- stefan1691
- Date:
- Fri Apr 15 18:14:33 2016 +0000
- Parent:
- 13:1cbd0d5773dc
- Commit message:
- restsql mit HTTP GET
Changed in this revision
--- a/EthernetInterface.lib Fri Apr 15 14:28:39 2016 +0000 +++ b/EthernetInterface.lib Fri Apr 15 18:14:33 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f +http://mbed.org/users/mbed_official/code/EthernetInterface/#4d7bff17a592
--- a/cgi-bin/restsql.txt Fri Apr 15 14:28:39 2016 +0000 +++ b/cgi-bin/restsql.txt Fri Apr 15 18:14:33 2016 +0000 @@ -1,11 +1,26 @@ #!/bin/bash # # Mittels HTTP POST in MySQL Schreiben - + # HTTP Header fuer Client echo "Content-type: text/plain" echo "" - + +# +### GET +# +if [ "$REQUEST_METHOD" = "GET" ] +then + export SQL="SELECT * FROM data;" + + echo "$SQL" + echo "" + mysql -uwww-data -pmbed sensoren <<EOF + ${SQL} +EOF + +fi + # ### POST # @@ -16,7 +31,7 @@ IFS='=&' parm=(`cat -`) IFS=$saveIFS - + printf "write to SQL Database: " FIELDS="" DATA="" @@ -35,5 +50,5 @@ mysql -uwww-data -pmbed sensoren <<EOF ${SQL} EOF - + fi
--- a/mbed-rtos.lib Fri Apr 15 14:28:39 2016 +0000 +++ b/mbed-rtos.lib Fri Apr 15 18:14:33 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#2db19f47c2ba +http://mbed.org/users/mbed_official/code/mbed-rtos/#bdd541595fc5