def _request(method, url, content_type=None, _data=None):
    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 HTTPError as exc:
        return {'error': '{0}'.format(exc)}
    return json.loads(handler.read())
Makes a HTTP request. Returns the JSON parse, or an obj with an error.
dataset/ETHPy150Open saltstack/salt/salt/returners/couchdb_return.py/_request