POST json data to the url provided and verify the requests was successful

def post(json_data,
         url,
         dry_run=False):
    """
    POST json data to the url provided and verify the requests was successful

    """

    if dry_run:
        info('POST: %s' % json.dumps(json_data, indent=4))
    else:
        response = SESSION.post(url,
                                data=json.dumps(json_data),
                                headers={'content-type': 'application/json'})

        if response.status_code != 200:
            raise Exception("Failed to import %s with %s: %s" %
                            (json_data, response.status_code, response.text))