|
META TOPICPARENT |
name="Exercises" |
A WEB Server and the HTTP Protocol
Exercise 1: Write a Hello World WEB Server |
|
< < | Follow the explanation in WEBServer and create the 3 versions of the Hello World Web Server. |
> > | Write a simplistic WEB server, serving a single WEB page. This server is very similar to the TCP server written in the [WiFi]] exercises. It now waits for a connection on port 80, reads a request from the browser, and sends a simple HTML page as its response. Interpretation of the incoming request is not necessary because the server is only capable of sending a single page anyway.
Print the incoming HTTP request, which will look similar to this:
The request starts with "Content Get / HTTP/1.1"
The page seen by the browser will look similar to this:
|
| Exercise 2: Provide Measurement Data on the WEB Page
Modify the WEB server to provide temperature and humidity measured with the SHT30. The easiest way to accomplish this is static text like in the Hello World HTML page into which the measurements can be inserted. This can be done with utemplates, which are provided by picoweb. Have a look in the utemplates README.MD and in the examples directory of picoweb to understand how this is implemented. |
|
META FILEATTACHMENT |
attachment="sht30WebSite.png" attr="" comment="" date="1590609204" name="sht30WebSite.png" path="sht30WebSite.png" size="15849" user="UliRaich" version="1" |
|
|
> > |
META FILEATTACHMENT |
attachment="http.png" attr="" comment="" date="1664785077" name="http.png" path="http.png" size="107586" user="UliRaich" version="1" |
META FILEATTACHMENT |
attachment="helloWorldWebServerV1.png" attr="" comment="" date="1664785325" name="helloWorldWebServerV1.png" path="helloWorldWebServerV1.png" size="39692" user="UliRaich" version="1" |
|