I'm having great difficulty downloading files from a sharepoint server in my flask application.
I'm making a get request to the sharepoint api to get the file and it looks successful when I print my download object
But I cant figure out how to decode the content and then send for download
I've tried the below
return send_file(BytesIO(download.content), mimetype='application/pdf', as_attachment=True, attachment_filename='test.pdf')
But when i try to open it looks like it hasn't decoded properly