def post_file(session, url, name, filelike, mimetype):
    """Send a data file."""
    details = (name, filelike, mimetype)
    with session.post(url, files={'file': details}) as response:
        response.raise_for_status()
        return response.json()