docs/esp8266: In TCP tutorial, add HTTP response code and content-type.

Show how to send an HTTP response code and content-type.  Without the
response code Safari/iOS will fail.  Without the content-type Lynx/Links
will fail.
pull/5612/head
Jesse Andrews 2020-01-24 07:14:24 -08:00 zatwierdzone przez Damien George
rodzic 4ab8bee82f
commit c4ea4c1810
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -118,5 +118,6 @@ that contains a table with the state of all the GPIO pins::
break
rows = ['<tr><td>%s</td><td>%d</td></tr>' % (str(p), p.value()) for p in pins]
response = html % '\n'.join(rows)
cl.send('HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n')
cl.send(response)
cl.close()