I have a csv file, which I need to post on my server, convert it to json and send it back. With JSON, you can simply do request.json(Force=True), however I am not sure how to make flask to read my csv.
So far I have this:
@application.route('/postcsv', methods=['POST'])
def csv_view():
content = request.files(force=True)
stream = io.StringIO(content.stream.read().decode("UTF-8"), newline = None)
csv_input = csv.reader(stream)
print(csv_input)
return csv_input
if __name__ == '__main__':
application.run(debug=True, host='0.0.0.0')
The error I am getting is TypeError: 'ImmutableMultiDict' object is not callable
. I think my approach overall is wrong but I am not sure