Commits

codernity  committed 554b835

Changes to latest python-requests release

  • Participants
  • Parent commits 0b6ad2f

Comments (0)

Files changed (1)

File CodernityDBPyClient/database.py

 
     custom_header = ""
 
-    def __init__(self, path=None, url='http://localhost:9876', keep_alive=True, auth=('admin', 'password'), content_type='application/json', encoding='utf-8', connect=True):
+    def __init__(self, path=None, url='http://localhost:9876', auth=('admin', 'password'), content_type='application/json', encoding='utf-8', connect=True):
         self._path = path
         self.set_content_type(content_type)
         self.url = url
         self.path = path
-        self.keep_alive = keep_alive
         self.auth = auth
         self.set_encoding(encoding)
         self.session = None
         url = "%s/%s" % (self.url, function)
         data = self.__dumps(data)
         result = self.session.post(url, headers=headers,
-                                   auth=self.auth, data=data, prefetch=False)
+                                   auth=self.auth, data=data, stream=True)
         if not result.status_code == requests.codes.ok:
             raise_proper_exception(result, self.__loads)
         return result.raw.read()
 
     def connect(self):
         self.session = requests.session()
-        self.session.config['keep_alive'] = self.keep_alive
         res = self.check_connection()
         if res:
             self.remote_init()