
Alternative TCPSocket example using an HTTP GET to read a short "helloworld" text web page using a different server
Fork of ARMs demo HTTP socket demo. ARM's server was redirected and the demo was no longer working. An alternative server was setup and the code was modified to display the web page text in addition to just "200 OK". Only works for a very short web page - buffer only 400 characters but RAM is running out on the LPC1768 in the demo! Data read from the web page is read and parsed to control the mbed's 4 LEDs for a basic IoT demo.
README.md@6:9cf6630fa25d, 2021-02-17 (annotated)
- Committer:
- 4180_1
- Date:
- Wed Feb 17 18:55:05 2021 +0000
- Revision:
- 6:9cf6630fa25d
- Parent:
- 0:6b383744246e
ver 1.2 Added Basic IoT demo controlling LEDs from web page data
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mab5449 | 0:6b383744246e | 1 | ### Getting started with the network-socket API ### |
mab5449 | 0:6b383744246e | 2 | |
mab5449 | 0:6b383744246e | 3 | This is a quick example of a simple HTTP client program using the |
mab5449 | 0:6b383744246e | 4 | network-socket API that is provided as a part of [mbed-os](github.com/armmbed/mbed-os). |
mab5449 | 0:6b383744246e | 5 | |
mab5449 | 0:6b383744246e | 6 | The program brings up an underlying network interface, and uses it to perform an HTTP |
mab5449 | 0:6b383744246e | 7 | transaction over a TCPSocket. |
mab5449 | 0:6b383744246e | 8 | |
mab5449 | 0:6b383744246e | 9 | **Note:** The current example is limited to the ethernet interface on supported devices. |
mab5449 | 0:6b383744246e | 10 | To use the example with a different interface, you will need to modify main.cpp and |
mab5449 | 0:6b383744246e | 11 | replace the EthernetInterface class with the appropriate interface. |
mab5449 | 0:6b383744246e | 12 | |
mab5449 | 0:6b383744246e | 13 | ### Documentation ### |
mab5449 | 0:6b383744246e | 14 | |
mab5449 | 0:6b383744246e | 15 | More information on the network-socket API can be found in the [mbed handbook](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.1/APIs/communication/network_sockets/). |