This creates an HTTP message
with the content of BODY as the enclosed representation
for the resource http://localhost:8080/foobar
...
import httplib
BODY = "***filecontents***"
conn = httplib.HTTPConnection("localhost", 8080)
conn.request("PUT", "/file", BODY)
response = conn.getresponse()
print response.status, response.reason
200, OK
这个是官方文档的例子,我看了下request的方法代码,参数还可以传个headers进去。就像这样:conn.request("PUT", "/file", body=BODY,headers={}),那我现在file后边还有参数的,我怎么加进去。就是这样的put host/file.txt?aaa=bbb&ccc=ddd