def get_response_data(response):
    """ Handles getting response data from the requests module where .json() can raise an error """
    try:
        return response.json()
    except ValueError:
        return response.content