Skip to content

Commit 140c0e1

Browse files
committed
Minor adjustments to examples
1 parent c758e51 commit 140c0e1

File tree

7 files changed

+13
-7
lines changed

7 files changed

+13
-7
lines changed

docs/examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ That makes it easy to use the data in other applications.
5656
Chunked response
5757
---------------------
5858

59-
Libraries supports chunked responses. This is useful for streaming data.
59+
Library supports chunked responses. This is useful for streaming data.
6060
To use it, you need to set the ``chunked=True`` when creating a ``HTTPResponse`` object.
6161

6262
.. literalinclude:: ../examples/httpserver_chunked.py

examples/httpserver_chunked.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import socketpool
88
import wifi
99

10+
from adafruit_httpserver.request import HTTPRequest
1011
from adafruit_httpserver.response import HTTPResponse
1112
from adafruit_httpserver.server import HTTPServer
1213

@@ -22,7 +23,7 @@
2223

2324

2425
@server.route("/chunked")
25-
def chunked(request):
26+
def chunked(request: HTTPRequest):
2627
"""
2728
Return the response with ``Transfer-Encoding: chunked``.
2829
"""

examples/httpserver_cpu_information.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import wifi
1111

1212
from adafruit_httpserver.mime_type import MIMEType
13+
from adafruit_httpserver.request import HTTPRequest
1314
from adafruit_httpserver.response import HTTPResponse
1415
from adafruit_httpserver.server import HTTPServer
1516

@@ -25,7 +26,7 @@
2526

2627

2728
@server.route("/cpu-information")
28-
def cpu_information_handler(request):
29+
def cpu_information_handler(request: HTTPRequest):
2930
"""
3031
Return the current CPU temperature, frequency, and voltage as JSON.
3132
"""

examples/httpserver_mdns.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import wifi
1010

1111
from adafruit_httpserver.mime_type import MIMEType
12+
from adafruit_httpserver.request import HTTPRequest
1213
from adafruit_httpserver.response import HTTPResponse
1314
from adafruit_httpserver.server import HTTPServer
1415

@@ -28,7 +29,7 @@
2829

2930

3031
@server.route("/")
31-
def base(request):
32+
def base(request: HTTPRequest):
3233
"""
3334
Serve the default index.html file.
3435
"""

examples/httpserver_neopixel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import wifi
1111

1212
from adafruit_httpserver.mime_type import MIMEType
13+
from adafruit_httpserver.request import HTTPRequest
1314
from adafruit_httpserver.response import HTTPResponse
1415
from adafruit_httpserver.server import HTTPServer
1516

@@ -27,7 +28,7 @@
2728

2829

2930
@server.route("/change-neopixel-color")
30-
def change_neopixel_color_handler(request):
31+
def change_neopixel_color_handler(request: HTTPRequest):
3132
"""
3233
Changes the color of the built-in NeoPixel.
3334
"""

examples/httpserver_simple_poll.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import wifi
99

1010
from adafruit_httpserver.mime_type import MIMEType
11+
from adafruit_httpserver.request import HTTPRequest
1112
from adafruit_httpserver.response import HTTPResponse
1213
from adafruit_httpserver.server import HTTPServer
1314

@@ -23,7 +24,7 @@
2324

2425

2526
@server.route("/")
26-
def base(request):
27+
def base(request: HTTPRequest):
2728
"""
2829
Serve the default index.html file.
2930
"""

examples/httpserver_simple_serve.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import wifi
99

1010
from adafruit_httpserver.mime_type import MIMEType
11+
from adafruit_httpserver.request import HTTPRequest
1112
from adafruit_httpserver.response import HTTPResponse
1213
from adafruit_httpserver.server import HTTPServer
1314

@@ -23,7 +24,7 @@
2324

2425

2526
@server.route("/")
26-
def base(request):
27+
def base(request: HTTPRequest):
2728
"""
2829
Serve the default index.html file.
2930
"""

0 commit comments

Comments
 (0)