Issue:
Endpoint methods currently return the JSON result from the API as a python object.
This means all other information regarding the response is lost, such as the status code. It also means the return type is unknown as it can sometimes be a list and other times a dict.
This leads to the issue that the only way to determine if a response was a 400 or 200 is by inspecting the returned result.
Proposed solution:
Return response objects with either the content attribute decoded and replaced in place or with another attribute result with the decoded JSON. the decoded json content is available with response.json()
I am happy to make a PR for this but it's a backwards incompatible change!
Perhaps there is a way to make it backwards compatible by returning an object of a custom class that behaves as the list/dict but with extra attributes for the response object. But this sounds complicated =]
Issue:
Endpoint methods currently return the JSON result from the API as a python object.
This means all other information regarding the response is lost, such as the status code. It also means the return type is unknown as it can sometimes be a list and other times a dict.
This leads to the issue that the only way to determine if a response was a 400 or 200 is by inspecting the returned result.
Proposed solution:
Return response objects
with either thethe decoded json content is available withcontentattribute decoded and replaced in place or with another attributeresultwith the decoded JSON.response.json()I am happy to make a PR for this but it's a backwards incompatible change!
Perhaps there is a way to make it backwards compatible by returning an object of a custom class that behaves as the list/dict but with extra attributes for the response object. But this sounds complicated =]