def connectionLost(self, reason):
        """
        Called when the response body has been completely delivered.
        @param reason: Either a twisted.web.client.ResponseDone exception or
        a twisted.web.http.PotentialDataLoss exception.
        """
        self.remaining.reset()

        try:
            result = json.load(self.remaining)
        except Exception, e:
            self.finished.errback(e)
            return

        returnValue = result
        if self.heartbeater:
            self.heartbeater.nextToken = result['token']
            returnValue = (result, self.heartbeater)

        self.finished.callback(returnValue)
Called when the response body has been completely delivered.
        @param reason: Either a twisted.web.client.ResponseDone exception or
        a twisted.web.http.PotentialDataLoss exception.