HTTP(GET/POST) client see: http://mbed.org/users/gsfan/notebook/gainspan_wifi/

Dependencies:   GSwifi mbed

Files at this revision

API Documentation at this revision

Comitter:
gsfan
Date:
Mon May 20 01:32:13 2013 +0000
Parent:
0:940529a06f88
Commit message:
fix;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon May 20 01:29:00 2013 +0000
+++ b/main.cpp	Mon May 20 01:32:13 2013 +0000
@@ -1,5 +1,5 @@
 /*
- * HTTP client and NTP client
+ * HTTP(GET/POST) client
  */
 
 #include "mbed.h"
@@ -8,6 +8,7 @@
 #define HTTP_HOST "www.mbed.org"
 #define HTTP_PORT 80
 #define HTTP_URI "/"
+#define HTTP_BODY "KEY=VALUE&key=value"
 
 #define SECURE GSwifi::GSSEC_WPA_PSK
 #define SSID "SSID"
@@ -55,6 +56,7 @@
     host.setName(HTTP_HOST);
     host.setPort(HTTP_PORT);
     r = gs.httpGet(host, HTTP_URI, 0, &onGsReceive);
+//    r = gs.httpPost(host, HTTP_URI, HTTP_BODY, 0, &onGsReceive);
     if (r >= 0) {
         for (;;) {
             gs.poll();