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 da
Alternatively:
req = urllib2.Request("http://example.com", data, {'Content-Type': 'application/octet-stream'}) urllib2.urlopen(req)
That also shows how you can specify the Content-Type of the data.