How to create flask api call to create dynamic html email content body from a file and send mail using smtplib?

Solution
curl -i -X PUT -F name=Test -F filedata=@SomeFile.pdf "http://localhost:5000/" 
file = request.files['filedata']   # gives you a FileStorage
test = request.form['name']        # gives you the string 'Test'