full_path = '%s&%s=' %(full_path, k)
conn = HTTPConnection(self.host)
- #encode whitespace
- full_path = full_path.replace(' ', '%20')
+ full_path = urllib.quote(full_path, '?&:=/')
kwargs = {}
for k,v in headers.items():
full_path = '%s&%s=%s' %(full_path, k, v)
else:
full_path = '%s&%s=' %(full_path, k)
+
+ full_path = urllib.quote(full_path, '?&:=/')
+
http.putrequest(method, full_path)
http.putheader('x-auth-token', self.token)
http.putheader('content-type', 'application/octet-stream')
elif format == 'xml':
data = minidom.parseString(data)
else:
- data = data.strip().split('\n') if data else ''
+ data = data.split('\n') if data else ''
return data
def _get_metadata(self, path, prefix=None, params={}):
l = [elem for elem in l if eval(elem)]
for elem in l:
headers.update({elem:eval(elem)})
-
+
if 'content_range' not in headers.keys():
if offset != None:
headers['content_range'] = 'bytes %s-/*' % offset