0

Am trying to connect an API in my organization, but am always receiving the below error message. But being able to connect other similar API/reports using the same below script. Am able to get results when running the API URL in a web browser. So there is no authentication issues.

I believe the server closed before sending any response.

Kindly help me to resolve this.

Error Message: RemoteDisconnected: "Remote end closed connection without response"

Code :

import http.client
import pandas as pd
import json
import requests

conn=http.client.HTTPSConnection("abc.com")
headers = {
         'authorization' : 'xyz'
         'cache-control': "no-cache"
         'postman-token: 'xyz'
}

url='xxyyzz'
conn.request("GET",url,headers=headers)
res=conn.getresponse()
data=res.read()
data_z=json.loads(data)
df=pd.DataFrame(datax['rows'])


Guruprakash
  • 13
  • 1
  • 5
  • Does [this](https://stackoverflow.com/questions/48105448/python-http-server-client-remote-end-closed-connection-without-response-error) answer your question? – Shag Jan 20 '21 at 12:42
  • @Shag , Thanks for the reply. As being new to python, I couldn't understand what discussed over there or how to apply " send_response(code, message='None') . An example will be appreciated – Guruprakash Jan 21 '21 at 09:01

0 Answers0