I've written an API to return a CSV to a user based on content they fill into a form in a web application. When running the code below, I can see the response in my console and am certain that the content is properly being returned by my API, but I can't seem to get the file to automatically start downloading.
csv = final_df.to_csv()
response = make_response(csv)
response.headers['Content-Disposition'] = "attachment; filename=export.csv"
response.headers['Content-type'] = "application/force-download"
return response