This is a quick example of a simple HTTP client program using the network-socket API that is provided as a part of mbed-os. The program brings up an underlying network interface, and uses it to perform an HTTP transaction over a TCPSocket.

Revision:
48:f2739ac5cb01
Parent:
47:08787ef063cb
Child:
49:1923a727df5b
--- a/main.cpp	Wed Jun 06 15:00:09 2018 +0100
+++ b/main.cpp	Mon Jun 18 09:15:03 2018 +0100
@@ -14,6 +14,11 @@
 
     // Bring up the ethernet interface
     printf("Ethernet socket example\n");
+
+#ifdef MBED_MAJOR_VERSION
+    printf("Mbed OS version %d.%d.%d\n\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
+#endif
+
     r = net.connect();
     if (r != 0) {
         printf("Error! net.connect() returned: %d\n", r);