File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def mime_type(filename):
174
174
175
175
176
176
class HTTPResponse :
177
- """Details of an HTTP response. Use in @ `HTTPServer.route` decorator functions."""
177
+ """Details of an HTTP response. Use in `HTTPServer.route` decorator functions."""
178
178
179
179
_HEADERS_FORMAT = (
180
180
"HTTP/1.1 {}\r \n "
@@ -365,8 +365,8 @@ def poll(self):
365
365
@property
366
366
def requestbuffersize (self ) -> int :
367
367
"""
368
- The maximum size of the incoming request buffer. If the default size isn't
369
- adequate to handle your incoming data you can set this after creating the
368
+ The maximum size of the incoming request buffer. If the default size isn't
369
+ adequate to handle your incoming data you can set this after creating the
370
370
server instance.
371
371
372
372
Default size is 1024 bytes.
Original file line number Diff line number Diff line change @@ -6,3 +6,22 @@ Ensure your device works with this simple test.
6
6
.. literalinclude :: ../examples/httpserver_simpletest.py
7
7
:caption: examples/httpserver_simpletest.py
8
8
:linenos:
9
+
10
+ Temperature test
11
+ --------------------
12
+
13
+ Send the microcontroller temperature back to the browser with this simple test.
14
+
15
+ .. literalinclude :: ../examples/httpserver_temperature.py
16
+ :caption: examples/httpserver_temperature.py
17
+ :linenos:
18
+
19
+ Simple polling test
20
+ -------------------
21
+
22
+ If you want your code to do more than just serve web pages,
23
+ use the start/poll methods as shown in this example.
24
+
25
+ .. literalinclude :: ../examples/httpserver_simplepolling.py
26
+ :caption: examples/httpserver_simplepolling.py
27
+ :linenos:
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ def base(request): # pylint: disable=unused-argument
30
30
31
31
while True :
32
32
try :
33
+ # do something useful in this section
33
34
# processing any waiting requests
34
35
server .poll ()
35
36
except OSError :
You can’t perform that action at this time.
0 commit comments