tusdatos_connector/tusdatos_connector.py
def api_post(self, command, payload):
        """Connection handler for POST calls.

        Args:
            command (String): Especific endpoit to deliver the request.
            payload (Dict): Dictionary with the required information by TusDatos service.

        Returns:
            Json: JSON object with the answer from the service, or the error.
        """
        try:
            return self.session.post(f"{self.url}{command}", json=payload).json()

        except (
            requests.exceptions.ConnectTimeout,
            requests.exceptions.ConnectionError,
            requests.exceptions.Timeout,
        ) as e:
            return json.dumps(
                {
                    "error": True,
                    "error message": "There is an error when connecting to TusDatos, try again later.",
                    "error trace": f"{e}",
                },
                sort_keys=True,
                indent=4,
            )
Connection handler for POST calls.

        Args:
            command (String): Especific endpoit to deliver the request.
            payload (Dict): Dictionary with the required information by TusDatos service.

        Returns:
            Json: JSON object with the answer from the service, or the error.
        
Connection handler for POST calls.
Connection handler for POST calls .
def api_post(self, command, payload):
        try:
            return self.session.post(f"{self.url}{command}", json=payload).json()
        except (
            requests.exceptions.ConnectTimeout,
            requests.exceptions.ConnectionError,
            requests.exceptions.Timeout,
        ) as e:
            return json.dumps(
                {
                    "error": True,
                    "error message": "There is an error when connecting to TusDatos, try again later.",
                    "error trace": f"{e}",
                },
                sort_keys=True,
                indent=4,
            )
def api_post ( self , command , payload ) : try : return self . session . post ( f"{self.url}{command}" , json = payload ) . json ( ) except ( requests . exceptions . ConnectTimeout , requests . exceptions . ConnectionError , requests . exceptions . Timeout , ) as e : return json . dumps ( { "error" : True , "error message" : "There is an error when connecting to TusDatos, try again later." , "error trace" : f"{e}" , } , sort_keys = True , indent = 4 , )
Connection handler for POST calls.
Connection handler for POST calls .
"""Connection handler for POST calls.

        Args:
            command (String): Especific endpoit to deliver the request.
            payload (Dict): Dictionary with the required information by TusDatos service.

        Returns:
            Json: JSON object with the answer from the service, or the error.
        """
JSON object with the answer from the service, or the error.
JSON object with the answer from the service or the error .
Json
self
command
Especific endpoit to deliver the request.
Especific endpoit to deliver the request .
payload
Dictionary with the required information by TusDatos service.
Dictionary with the required information by TusDatos service .