I am sending a POST request with cURL to Flask Restful API as:
curl -X POST -H 'Content-Type: text/csv' -d @trace.csv http://localhost:5000/upload
I am not able to read this data from this request or I don't know how to read the data. Below is my implementation of the API:
class ForBetaAndUpload(Resource):
def post(self, kind='quotes'):
parser = reqparse.RequestParser()
parser.add_argument('file')
args = parser.parse_args()['file']
print(args) #Prints: Null
api.add_resource(ForBetaAndUpload, '/upload', endpoint='upload')
if __name__ == "__main__":
app.run(debug=True)
How can I read the csv file data that I'm sending with cURL. I'll very much appreciate your help.