def execute_query(self): """Submit pending request to the server""" for request in self._build_request(): try: response = self.execute_request_direct(request) response.raise_for_status() self.process_response(response) except HTTPError as e: raise ClientRequestException(*e.args, response=e.response) self.clear()
def execute_query(self): """Submit a pending request to the server""" try: request = self.build_request() self.beforeExecute.notify(request) response = self.execute_request_direct(request) response.raise_for_status() self.process_response(response) self.afterExecute.notify(response) except HTTPError as e: raise ClientRequestException(*e.args, response=e.response)
def validate_response(self, response): try: response.raise_for_status() except HTTPError as e: raise ClientRequestException(*e.args, response=e.response)