import requests


def shock_download(url, token):
    """ Download data from a Shock node.

    Parameters
    ----------
    url : str
        URL to Shock node
    token : str
        Authentication token for Patric web services

    Returns
    -------
    str
        Data from Shock node
    """

    response = requests.get(url + '?download', headers={'Authorization': 'OAuth ' + token}, verify=False)
    if response.status_code != requests.codes.OK:
        response.raise_for_status()
    return response.text