Commits

Anonymous committed 67d95d0

fix path encoding. "/" souldn't be %2F

Comments (0)

Files changed (1)

restclient/rest.py

         
         headers = headers or {}
 
-        resp, data = self.httpclient.request(make_uri(uri, path, **params), method=method,
-                body=body, headers=headers)
+        resp, data = self.httpclient.request(make_uri(uri, path, **params), 
+                method=method, body=body, headers=headers)
 
         status_code = int(resp.status)
 
     retval = [base]
 
     # build the path
-    path = '/'.join([''] +
-                    [unicode_quote(s.strip('/')) for s in path
-                     if s is not None])
+    path_ = ''
+    for p in path:
+        path_ = '/'.join([unicode_quote(s) for s in p.split('/') if s is not None])
+    
     if path:
-        retval.append(path)
+        retval.append(path_)
 
     params = []
     for k, v in query.items():