Ejemplo n.º 1
0
 def __init__(self,
              data: dict = {},
              status: int = 200,
              headers={},
              content_type: str = 'application/json'):
     response_headers = app_config['headers'].copy()
     if headers:
         response_headers.update(headers)
     response_body = {'status': status}
     if data:
         response_body['data'] = data
     Response.__init__(self,
                       text=json.dumps(response_body),
                       status=APIResponse.status_code,
                       content_type=content_type,
                       headers=response_headers)