diff options
author | Jesse Andrews <anotherjesse@gmail.com> | 2020-01-24 07:14:24 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-02-03 23:50:09 +1100 |
commit | c4ea4c1810cac0725b348d77322abc5ba5b1ac80 (patch) | |
tree | 0d35c47f78ee39ac71481fc16a5478c4a68da2ae /docs/esp8266 | |
parent | 4ab8bee82f7d095c10c624de93da12a7aa1af8fd (diff) | |
download | micropython-c4ea4c1810cac0725b348d77322abc5ba5b1ac80.tar.gz micropython-c4ea4c1810cac0725b348d77322abc5ba5b1ac80.zip |
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.
Diffstat (limited to 'docs/esp8266')
-rw-r--r-- | docs/esp8266/tutorial/network_tcp.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/docs/esp8266/tutorial/network_tcp.rst b/docs/esp8266/tutorial/network_tcp.rst index d479f62e6a..18916884e4 100644 --- a/docs/esp8266/tutorial/network_tcp.rst +++ b/docs/esp8266/tutorial/network_tcp.rst @@ -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() |