Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions adafruit_httpserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class _HTTPRequest:
def __init__(
self, path: str = "", method: str = "", raw_request: bytes = None
) -> None:
self.raw_request = raw_request
if raw_request is None:
self.path = path
self.method = method
Expand Down Expand Up @@ -287,7 +288,10 @@ def route(self, path: str, method: str = "GET"):

@server.route(path, method)
def route_func(request):
raw_text = request.raw_request.decode("utf8")
print("Received a request of length", len(raw_text), "bytes")
return HTTPResponse(body="hello world")

"""

def route_decorator(func: Callable) -> Callable:
Expand Down