且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过 HTTP 发送二进制 post 数据?

更新时间:2022-05-18 03:24:24

或者:

req = urllib2.Request("http://example.com", data, {'Content-Type': 'application/octet-stream'})
urllib2.urlopen(req)

这也说明了如何指定数据的 Content-Type.

That also shows how you can specify the Content-Type of the data.