Skip to content

basic_bot.commons.web_utils_aiohttp

Utility functions for handling aiohttp web responses.

json_response

def json_response(status: int, data: Any) -> Response

Return a JSON response using aiortc web.

respond_ok

def respond_ok(data: Any = None) -> Response

Return a JSON response with status ok.

AccessLogger Objects

class AccessLogger(AbstractAccessLogger)

enabled

@property
def enabled() -> bool

Return True if logger is enabled.

Override this property if logging is disabled to avoid the overhead of calculating details to feed the logger.

This property may be omitted if logging is always enabled.