Beispiel #1
0
 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)
Beispiel #2
0
async def test1(request):
    return text("hello worlds")
Beispiel #3
0
 def handler_exception(request, exception):
     return text('Internal Server Error.', 500)
Beispiel #4
0
 async def handler(request):
     headers = {"answer": 42}
     return text('Hello', headers=headers)
Beispiel #5
0
 async def handler(request):
     headers = {"spam": "great"}
     return text('Hello', headers=headers)
Beispiel #6
0
 async def handler(request):
     return text('Hello')
Beispiel #7
0
 async def handler(request):
     return text('OK')
Beispiel #8
0
 def handler(request):
     return text("{}".format(request.ip))
Beispiel #9
0
 async def handler(request):
     return text(request.remote_addr)
Beispiel #10
0
 async def handler(request):
     return text(request.content_type)