wsgi_app
¶
CircuitPython framework for creating WSGI server compatible web applications. This does not include server implementation, which is necessary in order to create a web application with this library.
Circuit Python implementation of an WSGI Server for ESP32 devices: https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI.git
Author(s): Matthew Costi
Implementation Notes¶
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
- class adafruit_wsgi.wsgi_app.WSGIApp¶
The base WSGI Application class.
- on_request(methods: List[str], rule: str, request_handler: Callable)¶
Register a Request Handler for a particular HTTP method and path. request_handler will be called whenever a matching HTTP request is received.
- request_handler should accept the following args:
(Dict environ)
- request_handler should return a tuple in the shape of:
(status, header_list, data_iterable)
Request
¶
Author(s): Matthew Costi
- class adafruit_wsgi.request.Request(environ: Dict[str, str])¶
An incoming HTTP request. A higher level abstraction of the raw WSGI Environ dictionary.
- property body¶
The Request Body
- property headers: Dict[str, str]¶
Request headers, represented as a dictionary of header name to header value