Exemplo n.º 1
0
 async def error_handler(request, exception):
     return text('OK', exception.status_code)
Exemplo n.º 2
0
 async def handler(request):
     return text('Hello')
Exemplo n.º 3
0
 async def handler(request):
     headers = {"answer": 42}
     return text('Hello', headers=headers)
Exemplo n.º 4
0
 async def handler(request):
     args[0] = request.args
     return text('OK')
Exemplo n.º 5
0
 async def handler(request):
     arg[0] = request
     return text('OK')
Exemplo n.º 6
0
 def handler(request):
     return text('OK')
Exemplo n.º 7
0
 async def handler2(request):
     return text('OK2')
Exemplo n.º 8
0
 def post(self, request):
     return text('', headers={'method': 'POST'})
Exemplo n.º 9
0
 async def put(self, request):
     return text('', headers={'method': 'PUT'})
Exemplo n.º 10
0
 def get(self, request):
     self._iternal_method()
     return text('I am get method and global var is {}'.format(
         self.global_var))
Exemplo n.º 11
0
        async def get(self, request):
            print('进来了')
            assert request.stream is None

            return text('', headers={'method': 'GET'})
Exemplo n.º 12
0
 async def process_response(request, response):
     return text('OK')
Exemplo n.º 13
0
 async def handler(request):
     return text('FAIL')
Exemplo n.º 14
0
 async def halt_request(request):
     return text('OK')
Exemplo n.º 15
0
 async def handler(request, folder_id):
     results.append(folder_id)
     return text('OK')
Exemplo n.º 16
0
 def head(self, request):
     return text('', headers={'method': 'HEAD'})
Exemplo n.º 17
0
 async def handler(request, weight):
     results.append(weight)
     return text('OK')
Exemplo n.º 18
0
 def options(self, request):
     return text('', headers={'method': 'OPTIONS'})
Exemplo n.º 19
0
 async def handler1(request):
     return text('OK1')
Exemplo n.º 20
0
 async def patch(self, request):
     return text('', headers={'method': 'PATCH'})
Exemplo n.º 21
0
 async def handler(request, name):
     results.append(name)
     return text('OK')
Exemplo n.º 22
0
 def delete(self, request):
     return text('', headers={'method': 'DELETE'})
Exemplo n.º 23
0
 async def handler(request, user_id):
     arg[0] = user_id
     return text('OK')
Exemplo n.º 24
0
 def get(self, request):
     return text('I am get method')
Exemplo n.º 25
0
 def handler(request):
     # print(request.ip)
     return text("{}".format(request.ip))
Exemplo n.º 26
0
 def get(self, request, my_param_here):
     return text('I am get method with %s' % my_param_here)
Exemplo n.º 27
0
 async def handler(request):
     headers = {"spam": "great"}
     return text('Hello', headers=headers)
Exemplo n.º 28
0
 def get(self, request):
     assert request.stream is None
     return text('I am get method')
Exemplo n.º 29
0
 def handler_exception(request, exception):
     return text('Internal Server Error.', 500)
Exemplo n.º 30
0
 def handler(request):
     return text('Hello2')