浏览代码

Adding timeout to http PUT

Andrej 1 月之前
父节点
当前提交
e089d587cb
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      orthancInterface.py

+ 2 - 2
orthancInterface.py

@@ -77,7 +77,7 @@ class orthancInterface:
         except urllib3.exceptions.HTTPError as e:
             print(e)
 
-    def put(self,url,data,dataType='octet-stream'):
+    def put(self,url,data,dataType='octet-stream',timeout=None):
 
         debug=False
 
@@ -91,7 +91,7 @@ class orthancInterface:
         #headers["Cookie"]=self.cookie
 
         try:
-            return self.http.request('PUT',url,headers=headers,body=data)
+            return self.http.request('PUT',url,headers=headers,body=data,timeout=timeout)
         #f contains json as a return value
         except urllib3.exceptions.HTTPError as e:
             print(e)