Skip to content

basic_bot.commons.web_utils

Utility functions for handling Flask web responses and requests.

json_response

def json_response(app: Flask, data: Any) -> Response

Return a JSON response.

respond_ok

def respond_ok(app: Flask, data: Optional[Any] = None) -> Response

Return a JSON response with status ok.

respond_not_ok

def respond_not_ok(app: Flask, status: str, data: Any) -> Response

Return a JSON response with status not ok.