'Will prepare response after executing an http request.'

def _execute_and_get_response_details(self, nas_ip, url, post_parm=None):

    LOG.debug('port:    %(port)s,    ssl:    %(ssl)s', {'port': self.port, 'ssl': self.ssl})
    res_details = {}
    if self.ssl:
        if hasattr(ssl, '_create_unverified_context'):
            context = ssl._create_unverified_context()
            connection = http_client.HTTPSConnection(nas_ip, port=self.port, context=context)
        else:
            connection = http_client.HTTPSConnection(nas_ip, port=self.port)
    else:
        connection = http_client.HTTPConnection(nas_ip, self.port)
    if (post_parm is None):
        connection.request('GET', url)
    else:
        headers = {'Content-Type': 'application/x-www-form-urlencoded', 'charset': 'utf-8'}
        connection.request('POST', url, post_parm, headers)
    start_time = time.time()
    response = connection.getresponse()
    elapsed_time = (time.time() - start_time)
    LOG.debug('cgi    elapsed_time:    %s', elapsed_time)
    data = response.read()
    LOG.debug('response    data:    %s', data)
    error_details = None
    res_details['data'] = data
    res_details['error'] = error_details
    res_details['http_status'] = response.status
    connection.close()
    return res_details
