you can do it with httplib:
import httplib
conn = httplib.HTTPConnection('www.foo.com')
conn.request('PUT', '/myurl', body)
resp = conn.getresponse()
content = resp.read()
also, check out this question. the accepted answer shows a way to add other methods to urllib2:
import urllib2
opener = urllib2.build_opener(urllib2.HTTPHandler)
request = urllib2.Request('http://example.org', data='your_put_data')
request.add_header('Content-Type', 'your/contenttype')
request.get_method = lambda: 'PUT'
url = opener.open(request)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…