def _net_worker(self, method, path, data='', headers={}, metadata={}):
connection = httplib.HTTPConnection(self.thehost)
if self.content_md5 != '':
headers['Content-MD5'] = self.content_md5
self.content_md5 = ''
if self.file_secret != '':
headers['Content-Secret'] = self.file_secret
self.file_secret = ''
final_headers = merge_meta(headers, metadata)
if self.upAuth:
self._add_upyun_auth_header(final_headers,method,path)
else :
self._basicAuth(final_headers,self.username,self.password)
connection.request(method, path , data, final_headers)
resp = connection.getresponse()
if self.debug and resp.status != 200 and method != "HEAD" :
raise UpYunException(u'ERROR: Code:%d,Message:%s'%(resp.status,resp.read()))
return resp
#??????
评论列表
文章目录