A response from SpaceGDN.
This class defines a response from the SpaceGDN API. It may represent both erroneous and successful responses from the API. Some convenience methods and fields are defined for easy analysis of the response.
This class is intended to be instantiated from pySpaceGDN, and not by an application using the framework. The Response object will then be populated by pySpaceGDN, with pages from SpaceGDN.
The status of the response is given by the last page got from SpaceGDN. If a page fails, no other pages will be loaded. When the response object is fully populated, it can be used by other classes.
When a Response object is first instantiated, status_code, status_reason and success is set to 0, ‘Not loaded’ and False, respectively.
Add data to this response.
This method should be used to add data to the response. The data should be all the data returned in one page from SpaceGDN.
If this method is called before, data will be appended to the existing data with +=, this means dicts, for instance will not work with multiple pages.
Check whether the response is a ‘malformed request’ response.
Check whether the response is a ‘rate limit exceeded’ response.