def rest_request_json(host, port, user, pswd, path, reason=''):
    err, conn, rest_json = rest_request(host, port, user, pswd, path,
                                        reason=reason)
    if err:
        return err, None, None
    if conn:
        conn.close()
    try:
        return None, rest_json, json.loads(rest_json)
    except __HOLE__, e:
        return ("error: could not decode JSON from REST API: %s:%s%s" +
                "; exception: %s" +
                "; please check URL, username (-u) and password (-p)") % \
                (host, port, path, e), None, None
dataset/ETHPy150Open membase/membase-cli/pump.py/rest_request_json