This Socket Example Program Implements a TCP Socket, UDP Socket, and HTTPClient socket then uses each of these to perform basic I/O.
Dependencies: JSON M2XStreamClient-JMF WNCInterface mbed-rtos mbed
See the README for details on this example program. NOTE: When started, the program can take up to 40 seconds before it will respond. This delay is the time required for the WNC Data Module to connect with the network.
Diff: main.cpp
- Revision:
- 7:beefa072a165
- Parent:
- 6:562eed9eca87
- Child:
- 9:667c078c40c6
diff -r 562eed9eca87 -r beefa072a165 main.cpp --- a/main.cpp Tue Nov 22 15:23:34 2016 +0000 +++ b/main.cpp Wed Nov 23 00:48:12 2016 +0000 @@ -33,7 +33,7 @@ // //demonstrate HTTPClient operations // - HTTPClient http; + HTTPClient http; char str[512]; printf("\n\n\n\n-------------------------------------" CRLF); @@ -42,7 +42,7 @@ //GET data printf(">>>>Fetch a page..." CRLF); - ret = http.get("http://developer.mbed.org/media/uploads/mbed_official/hello.txt", str, strlen(str)); + ret = http.get("https://developer.mbed.org/media/uploads/mbed_official/hello.txt", str, strlen(str)); if (!ret) { printf("Page fetched successfully - read %d characters" CRLF, strlen(str));