def METHOD_NAME(self, data):
    # pretty JSON in tracer curl logs
    try:
        return json.dumps(json.loads(data), sort_keys=True, indent=2, separators=(',', ': ')).replace("'", r'\u0027')
    except (ValueError, TypeError):
        # non-json data or a bulk request
        return data