Skip to main content
Question
FYERS API
Kamal
Kamalakar
Asked a question 3 months ago

I am trying to authorize access code with below code but it is throwing "gaierror: [Errno 11001] getaddrinfo failed" error. not sure why, can someone help me import http.client conn = http.client.HTTPSConnection("curl") payload = '' headers = { 'Authorization': 'app_id:XXXXXXXXX' } conn.request("GET", "/", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) Traceback (most recent call last): File "<ipython-input-162-bfb7b03e5b5f>", line 6, in <module> conn.request("GET", "/", payload, headers) File "C:\Users\anilk\anaconda3\lib\http\client.py", line 1255, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\Users\anilk\anaconda3\lib\http\client.py", line 1301, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\Users\anilk\anaconda3\lib\http\client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\Users\anilk\anaconda3\lib\http\client.py", line 1010, in _send_output self.send(msg) File "C:\Users\anilk\anaconda3\lib\http\client.py", line 950, in send self.connect() File "C:\Users\anilk\anaconda3\lib\http\client.py", line 1417, in connect super().connect() File "C:\Users\anilk\anaconda3\lib\http\client.py", line 921, in connect self.sock = self._create_connection( File "C:\Users\anilk\anaconda3\lib\socket.py", line 787, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "C:\Users\anilk\anaconda3\lib\socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): gaierror: [Errno 11001] getaddrinfo failed

Join FYERS Community to pick others' brains on Trading/Investing

No answers yet.