How to send image to Flask server from curl request
问题 I want to send an image by curl to flask server, i am trying this curl command curl -X POST -F file=image.jpg "http://127.0.0.1:5000/" but it did not work by the way on the server side i handle the image by this code image = Image.open(request.files['file']) i am trying to read the image using PIL Is there anyway to do this? Thanks in advance 回答1: This worked for me: curl -F "file=@image.jpg" http://localhost:5000/ The '@' is important, otherwise you end up with an http error 400 (server