'Initialize a RestResult containing the results from a REST call.
:param response: HTTP response'

def __init__(self, response=None, err=None):

    self.response = response
    self.error = err
    self.data = ''
    self.status = 0
    if self.response:
        self.status = self.response.getcode()
        result = self.response.read()
        while result:
            self.data += result
            result = self.response.read()
    if self.error:
        self.status = self.error.code
        self.data = http_client.responses[self.status]
    LOG.debug('Response    code:    %s', self.status)
    LOG.debug('Response    data:    %s', self.data)
