I have written a python script which includes a different request access to different endpoint. and I am getting connection error at any random line. Can you please provide any fix/solution for this.
We are using requests module like this…
with requests.Session() as session:
with session.post(url, headers=headers_iq) as response:
data = json.loads(response.content.decode(‘utf-8’))
[quote=“Ritika Pandey, post:1, topic:28725, full:true, username:ritika123”]
I have written a python script which includes a different request access to different endpoint. and I am getting connection error at any random line. Can you please provide any fix/solution for this.
We are using requests module like this…
with requests.Session() as session:
with session.post(url, headers=headers_iq) as response:
data = json.loads(response.content.decode(‘utf-8’))
and here is the Error:
"C:\Users\SDS\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Thanks for response, whatever I am passing in session.post() method url, headers_iq all contains a value. sometime code is getting executed successfully but other times it gives connectionError
Thanks, Let me explain you the whole process. I am integrating ConnectWise and Incident IIQ, so when I am importing tickets from CW to IIQ, after few tickets getting imported in between I am getting above mentioned, which I am trying to avoid. if I will run the code again manually or using try and except, data is getting overidden in IIQ.
I do not know those services. Can only suggest that you add retry logic to your code in the hope that it is an intermittent issue with the server. You will need to experiment with how long to wait before retrying. Maybe a few seconds but could be hours.