def _request_handler(self): request = bottle.request.body.read() response = self.process(request) return bottle.LocalResponse( body=response, status=200, headers={'content-type': 'application/json'})
def _request_handler(self): request = bottle.request.body.read() # pylint: disable=no-member response = self._process(request) return bottle.LocalResponse( body=json.dumps(response, cls=modeling.utils.ModelJSONEncoder), status=200, headers={'content-type': 'application/json'})
def _request_handler(self): request = bottle.request.body.read().decode('utf-8') with current_ctx.push(self.ctx): response = self.process(request) return bottle.LocalResponse( body=response, status=200, headers={'content-type': 'application/json'})
def setUp(self): self.request = AttrDict({"headers": {}}) self.response = bottle.LocalResponse()