materials-marketplace / python-sdk

Python software development kit for MarketPlace.
MIT License
0 stars 1 forks source link

Use json() property of responses to the proxy requests #37

Closed pablo-de-andres closed 2 years ago

pablo-de-andres commented 2 years ago

Currently, the requests sent to the proxy are loaded via json. Example from newTransformation capability:

 json.loads(
                self._client.post(
                    self._proxy_path("newTransformation"), json=new_transformation
                )
)

This gives an error, since the call to self._client.post() is returning a Response object. This can easily be fixed by replacing the call to json.loads() to the json() method of the response:

self._client.post(
                    self._proxy_path("newTransformation"), json=new_transformation
).json()