![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
testing
Dependencies: HTTPClient PowerControl SNICInterface_mod mbed-rtos mbed
Fork of Fx0Hackson by
Diff: main.cpp
- Revision:
- 6:1273e99a6058
- Parent:
- 5:3dbedd084f79
- Child:
- 7:bf74da76618b
diff -r 3dbedd084f79 -r 1273e99a6058 main.cpp --- a/main.cpp Sat Jan 31 13:49:47 2015 +0000 +++ b/main.cpp Sat Feb 14 09:06:17 2015 +0000 @@ -6,9 +6,9 @@ #include "PowerControl/EthernetPowerControl.h" #endif -#define DEMO_AP_SSID "SSID" +#define DEMO_AP_SSID "nad11-10e168" #define DEMO_AP_SECURITY_TYPE e_SEC_WPA2_AES -#define DEMO_AP_SECUTIRY_KEY "PASSWORD" +#define DEMO_AP_SECUTIRY_KEY "18e36c5e791f9" C_SNIC_WifiInterface wifi( p9, p10, NC, NC, p30 ); @@ -58,53 +58,6 @@ printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); } - //POST data - HTTPMap map; - HTTPText inText(str, 512); - map.put("Hello", "World"); - map.put("test", "1234"); - printf("\nTrying to post data...\n"); - ret = http.post("http://httpbin.org/post", map, &inText); - if (!ret) - { - printf("Executed POST successfully - read %d characters\n", strlen(str)); - printf("Result: %s\n", str); - } - else - { - printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); - } - - //PUT data - strcpy(str, "This is a PUT test!"); - HTTPText outText(str); - //HTTPText inText(str, 512); - printf("\nTrying to put resource...\n"); - ret = http.put("http://httpbin.org/put", outText, &inText); - if (!ret) - { - printf("Executed PUT successfully - read %d characters\n", strlen(str)); - printf("Result: %s\n", str); - } - else - { - printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); - } - - //DELETE data - //HTTPText inText(str, 512); - printf("\nTrying to delete resource...\n"); - ret = http.del("http://httpbin.org/delete", &inText); - if (!ret) - { - printf("Executed DELETE successfully - read %d characters\n", strlen(str)); - printf("Result: %s\n", str); - } - else - { - printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); - } - wifi.disconnect(); while(1) {