jiveapi.jiveresponse module

class jiveapi.jiveresponse.JiveResponse[source]

Bases: requests.models.Response

Subclass of requests.Response to handle automatically trimming the JSON Security String from the beginning of Jive API responses.

json(**kwargs)[source]

Returns the json-encoded content of a response, if any, with the leading JSON Security String stripped off.

Parameters:kwargs – Optional arguments that json.loads takes.
Raises:ValueError – If the response body does not contain valid json.
jiveapi.jiveresponse.requests_hook(response, **_)[source]

requests.Session response hook to return JiveResponse objects instead of plain requests.Response objects.

Add this to a requests.Session like session.hooks['response'].append(requests_hook)