def jsonify(data):
    indent = None if flask.request.is_xhr else 2

    jsonified = json.dumps(data, indent=indent)
    jsonified_safe = jsonified.replace('</', '<\\/')

    return flask.current_app.response_class(jsonified_safe,
            mimetype='application/json')
Returns a flask.Response of data, JSON-stringified.
dataset/ETHPy150Open vim-awesome/vim-awesome/web/api/api_util.py/jsonify