async def error_handler(request, exception): if request.method in ['HEAD', 'PATCH', 'PUT', 'DELETE']: return text( '', exception.status_code, headers=exception.headers ) else: return self.app.error_handler.default(request, exception)
async def test1(request): return text("hello worlds")
def handler_exception(request, exception): return text('Internal Server Error.', 500)
async def handler(request): headers = {"answer": 42} return text('Hello', headers=headers)
async def handler(request): headers = {"spam": "great"} return text('Hello', headers=headers)
async def handler(request): return text('Hello')
async def handler(request): return text('OK')
def handler(request): return text("{}".format(request.ip))
async def handler(request): return text(request.remote_addr)
async def handler(request): return text(request.content_type)