I am working on a web application using Flask. One of the views is supposed to accept uploaded files through PUT requests, however I only can get POST requests with $ curl -F upload=@filename URL
to work properly. With PUT requests such as $ curl --upload-file filenname URL
the request.files
ImmutableMultiDict is empty. Am I missing something in Flask or maybe with using curl?
相关问题
- Angular RxJS mergeMap types
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
PUT request is way different compared to POST request. With PUT request the file contents can be accessed using either
request.data
orrequest.stream
. The first one stores incoming data as string, whilerequest.stream
acts more like a file object, making it more suitable for binary data: