import json


def response_content(response):
    """
    Get response content. Try decoding as JSON first, otherwise return str
    version of content
    """
    try:
        resp_content = response.json()
    except json.decoder.JSONDecodeError:
        resp_content = response.text

    return resp_content