import requests


def multipart_post(upload_url, form_data, file_data):
    """Post multipart/file-data to an arbitrary URL.
    The response might contain a redirect to a confirmation URL, but we don't
    want this to happen automatically, because we usually want to capture the 
    JSON returned with the confirmation URL in a separate step.
    """
    return requests.post(upload_url, data = form_data, files = file_data, allow_redirects=False)