'Wrapper to handle connection'

def _opener(self, method, url, body, header):

    response = {}
    response['status'] = 0
    response['content'] = ''
    response['location'] = ''
    req = urllib.request.Request(url, body, header)
    req.get_method = (lambda : method)
    try:
        resp = urllib.request.urlopen(req)
    except urllib.error.HTTPError as err:
        response['status'] = err.code
        response['content'] = err.read()
    except urllib.error.URLError as err:
        response['status'] = 0
    else:
        response['status'] = resp.getcode()
        response['content'] = resp.read()
        response['location'] = resp.info().getheader('Content-Location', '')
    return response
