smd.iotkit2.ch / Mbed 2 deprecated 2-07-04-Uebung

Dependencies:   EthernetInterface TMP175 mbed-rtos mbed

Fork of HTTP_POST by smd.iotkit2.ch

Files at this revision

API Documentation at this revision

Comitter:
stefan1691
Date:
Fri Apr 15 18:14:33 2016 +0000
Parent:
13:1cbd0d5773dc
Commit message:
restsql mit HTTP GET

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
cgi-bin/restsql.txt Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
--- 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