'Gets the response and generates the _Response object'

def getresponse(self):

    status = self._httprequest.status()
    status_text = self._httprequest.status_text()
    resp_headers = self._httprequest.get_all_response_headers()
    fixed_headers = []
    for resp_header in resp_headers.split('\n'):
        if ((resp_header.startswith(' DCTB ') or resp_header.startswith('    ')) and fixed_headers):
            fixed_headers[(-1)] += resp_header
        else:
            fixed_headers.append(resp_header)
    headers = []
    for resp_header in fixed_headers:
        if (':' in resp_header):
            pos = resp_header.find(':')
            headers.append((resp_header[:pos].lower(), resp_header[(pos + 1):].strip()))
    body = self._httprequest.response_body()
    length = len(body)
    return _Response(status, status_text, length, headers, body)
