# Copyright (C) 2005-2025 Splunk Inc. All Rights Reserved. import json class ITOABaseController(object): """ Provide custom behaviors to all our web services """ @classmethod def render_json(cls, response_data, set_mime='application/json'): """ Used to convert objects into json responses. Also will change json mime type around to enable gzip compression :param response_data: the raw response itself :param set_mime: override the mime type of a response :return: returns the string response """ # Escape slashes if they exist in the data response = json.dumps(response_data).replace("