Commits

ben...@localhost.nymphormation.net  committed 8409362

little changes

  • Participants
  • Parent commits 531e514

Comments (0)

Files changed (2)

File restclient/rest.py

         """
         to set a new uri absolute path
         """
-        self.uri = self.client.make_uri(self.uri, path)
+        self.uri = self.client.make_uri(self.uri, 
+                path)
 
 
 class RestClient(object):

File restclient/transport.py

         headers.setdefault('User-Agent',
                            "%s %s" % (USER_AGENT, pycurl.version,))
 
+        # by default turn off default pragma
+        headers.setdefault('Cache-control', 'max-age=0')
+        headers.setdefault('Pragma', 'no-cache')
+
+        if method in 'PUT':
+            headers.setdefault('Expect', '100-continue')
+
         # encode url
-        url = iri2uri(url)
+        url = iri2uri(to_bytestring(url))
         
         c = pycurl.Curl()
         try:
             header = StringIO.StringIO()
             c.setopt(pycurl.WRITEFUNCTION, data.write)
             c.setopt(pycurl.HEADERFUNCTION, header.write)
-            c.setopt(pycurl.URL, to_bytestring(url))
+            c.setopt(pycurl.URL, url)
             c.setopt(pycurl.FOLLOWLOCATION, 1)
             c.setopt(pycurl.MAXREDIRS, 5)
             c.setopt(pycurl.NOSIGNAL, 1)