python httplib2 connection refused error10061

314 Views Asked by At

How to how to login and establish the connection with the token ..? i am getting response as --> {"detail":"Authentication credentials were not provided."} I tried with requests python library.

Also i am getting the error "target machine actively refused as given below" I tried httplib2 , If any one know Kindly help on this..... :-(

import httplib2

http = httplib2.Http()
resp = http.request("http://www.something.com", "HEAD")[0]

Traceback (most recent call last): File "", line 1, in resp = http.request("http://www.something.com", "HEAD")[0] File "C:\Users\vijayakumar.v\Downloads\python-rest-client-0.2.tar\python-rest-client\python-rest-client\httplib2__init__.py", line 1050, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "C:\Users\vijayakumar.v\Downloads\python-rest-client-0.2.tar\python-rest-client\python-rest-client\httplib2__init__.py", line 854, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "C:\Users\vijayakumar.v\Downloads\python-rest-client-0.2.tar\python-rest-client\python-rest-client\httplib2__init__.py", line 823, in _conn_request conn.request(method, request_uri, body, headers) File "C:\Python27\lib\httplib.py", line 1057, in request self._send_request(method, url, body, headers) File "C:\Python27\lib\httplib.py", line 1097, in _send_request self.endheaders(body) File "C:\Python27\lib\httplib.py", line 1053, in endheaders self._send_output(message_body) File "C:\Python27\lib\httplib.py", line 897, in _send_output self.send(msg) File "C:\Python27\lib\httplib.py", line 859, in send self.connect() File "C:\Users\vijayakumar.v\Downloads\python-rest-client-0.2.tar\python-rest-client\python-rest-client\httplib2__init__.py", line 715, in connect raise socket.error, msg error: [Errno 10061] No connection could be made because the target machine actively refused it

http = httplib2.Http()
resp = http.request("http://www.something.com", "GET")[0]

Traceback (most recent call last): File "", line 1, in resp = http.request("http://www.something.com", "GET")[0] File "C:\Users\vijayakumar.v\Downloads\python-rest-client-0.2.tar\python-rest-client\python-rest-client\httplib2__init__.py", line 1050, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "C:\Users\vijayakumar.v\Downloads\python-rest-client-0.2.tar\python-rest-client\python-rest-client\httplib2__init__.py", line 854, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "C:\Users\vijayakumar.v\Downloads\python-rest-client-0.2.tar\python-rest-client\python-rest-client\httplib2__init__.py", line 823, in _conn_request conn.request(method, request_uri, body, headers) File "C:\Python27\lib\httplib.py", line 1057, in request self._send_request(method, url, body, headers) File "C:\Python27\lib\httplib.py", line 1097, in _send_request self.endheaders(body) File "C:\Python27\lib\httplib.py", line 1053, in endheaders self._send_output(message_body) File "C:\Python27\lib\httplib.py", line 897, in _send_output self.send(msg) File "C:\Python27\lib\httplib.py", line 859, in send self.connect() File "C:\Users\vijayakumar.v\Downloads\python-rest-client-0.2.tar\python-rest-client\python-rest-client\httplib2__init__.py", line 715, in connect raise socket.error, msg error: [Errno 10061] No connection could be made because the target machine actively refused it

0

There are 0 best solutions below