import urllib2 opener = urllib2.build_opener() rq = urllib2.Request(url='http://www.baidu.com', data=file_str, headers={'Content-Type': 'application/txt'}) rs = opener.open(rq).read() print rs Previous Next ponxu / 2014-11-13 Categories Python Tags Python