import requests


def post_splunk(url, token, payload):
    """
        Send a post request to Splunk API
    """
    headers = {'Authorization': 'Splunk {}'.format(token)}
    res = requests.post(url=url, headers=headers, data=payload, verify=False)
    res.raise_for_status()
    return res.json()