I already have binary data read from a file. Most of the examples I see online link directly to the file, and upload the whole file. I am looking how to upload the binary data that I already have from another source via HTTP POST in python.
相关问题
- 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
Alternatively:
That also shows how you can specify the Content-Type of the data.
I'm not sure what online examples you're looking at, but
urllib2.urlopen
takes the data to post as a chunk of data and not a file at all.