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'])


2
  • Does this answer your question? Commented Jan 20, 2021 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 Commented Jan 21, 2021 at 9:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.