def _request(method, url, content_type=None, _data=None):
    '''
    Makes a HTTP request. Returns the JSON parse, or an obj with an error.
    '''
    opener = _build_opener(_HTTPHandler)
    request = _Request(url, data=_data)
    if content_type:
        request.add_header('Content-Type', content_type)
    request.get_method = lambda: method
    try:
        handler = opener.open(request)
    except __HOLE__ as exc:
        return {'error': '{0}'.format(exc)}
    return json.loads(handler.read())
dataset/ETHPy150Open saltstack/salt/salt/returners/couchdb_return.py/_request