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
def hello(self, request, key): return http.Response(text='Hello World!')
def power(self, request, value=1): return http.Response(text=str(value**2))