Prechádzať zdrojové kódy

修复附件数据处理异常Failed to establish a new connection

luojiehua 1 rok pred
rodič
commit
de1ec03b7a

+ 2 - 3
BaseDataMaintenance/dataSource/interface.py

@@ -34,9 +34,8 @@ def getAttachDealInterface(_data,_type,path="",restry=1,kwargs={},url=interface_
                         "type":_type}
             if len(kwargs.keys())>0:
                 _json.update(kwargs)
-            headers = {"Content-Type":"application/json"}
-            with requests.Session() as session:
-                _resp = session.post(url,data=_json,timeout=timeout)
+            headers = {"Content-Type":"application/json","Connection":"close"}
+            _resp = requests.post(url,data=_json,timeout=timeout,headers=headers)
 
             if _resp.status_code==200:
                 _result = json.loads(_resp.content.decode())