コード例 #1
0
 def process(self, request):
     try:
         response = http.Response()
         payload = yield from self.next(request)
     except http.Exception as exception:
         response = exception
         payload = {'message': str(response)}
     response.text = json.dumps(payload)
     response.content_type = 'application/json'
     return response
コード例 #2
0
ファイル: middlewares.py プロジェクト: graingert/interest
 def hello(self, request, key):
     return http.Response(text='Hello World!')
コード例 #3
0
 def power(self, request, value=1):
     return http.Response(text=str(value**2))