如何登录和 Build 与令牌的连接..?我收到响应 - > {“detail”:“未提供身份验证凭据 . ”}我尝试使用请求python库 .
另外我得到错误“目标机器主动拒绝如下给出”我试过httplib2,如果有人知道亲切帮助这个..... :-(
import httplib2
http = httplib2.Http()
resp = http.request("http://www.something.com", "HEAD")[0]
回溯(最近一次调用最后一次):文件“”,第1行,在resp = http.request(“http://www.something.com”,“HEAD”)[0]文件“C:\ Users \ vijayakumar .v \ Downloads \ python-rest-client-0.2.tar \ python-rest-client \ python-rest-client \ httplib2__init __ . py“,第1050行,请求(响应,内容)= self.request(conn,authority ,uri,request_uri,方法,正文, Headers ,重定向,缓存键)文件“C:\ Users \ vijayakumar.v \ Downloads \ python-rest-client-0.2.tar \ python-rest-client \ python-rest-client \ httplib2__init_.py“,第854行,在_request(响应,内容)= self._conn_request(conn,request_uri,method,body,headers)文件”C:\ Users \ vijayakumar.v \ Downloads \ python-rest-client-0.2 .tar \ python-rest-client \ python-rest-client \ httplib2__init __ . py“,第823行,在_conn_request中conn.request(方法,request_uri,body,headers)文件”C:\ Python27 \ lib \ httplib.py“ ,第1057行,请求self._send_request(方法,url,正文, Headers )文件“C:\ Python27 \ lib \ httplib.py”,第1097行,在_send_request self.endheaders(bo dy)文件“C:\ Python27 \ lib \ httplib.py”,第1053行,在endheaders中self._send_output(message_body)文件“C:\ Python27 \ lib \ httplib.py”,第897行,在_send_output self.send中( msg)文件“C:\ Python27 \ lib \ httplib.py”,第859行,发送self.connect()文件“C:\ Users \ vijayakumar.v \ Downloads \ python-rest-client-0.2.tar \ python -rest-client \ python-rest-client \ httplib2__init __ . py“,第715行,在connect raise socket.error,msg错误:[Errno 10061]无法 Build 连接,因为目标机器主动拒绝它
http = httplib2.Http()
resp = http.request("http://www.something.com", "GET")[0]
回溯(最近一次调用最后一次):文件“”,第1行,在resp = http.request(“http://www.something.com”,“GET”)[0]文件“C:\ Users \ vijayakumar .v \ Downloads \ python-rest-client-0.2.tar \ python-rest-client \ python-rest-client \ httplib2__init __ . py“,第1050行,请求(响应,内容)= self.request(conn,authority ,uri,request_uri,方法,正文, Headers ,重定向,缓存键)文件“C:\ Users \ vijayakumar.v \ Downloads \ python-rest-client-0.2.tar \ python-rest-client \ python-rest-client \ httplib2__init_.py“,第854行,在_request(响应,内容)= self._conn_request(conn,request_uri,method,body,headers)文件”C:\ Users \ vijayakumar.v \ Downloads \ python-rest-client-0.2 .tar \ python-rest-client \ python-rest-client \ httplib2__init __ . py“,第823行,在_conn_request中conn.request(方法,request_uri,body,headers)文件”C:\ Python27 \ lib \ httplib.py“ ,第1057行,请求self._send_request(方法,url,正文, Headers )文件“C:\ Python27 \ lib \ httplib.py”,第1097行,在_send_request self.endheaders(bod)中y)文件“C:\ Python27 \ lib \ httplib.py”,第1053行,在endheaders中self._send_output(message_body)文件“C:\ Python27 \ lib \ httplib.py”,第897行,在_send_output self.send中( msg)文件“C:\ Python27 \ lib \ httplib.py”,第859行,发送self.connect()文件“C:\ Users \ vijayakumar.v \ Downloads \ python-rest-client-0.2.tar \ python -rest-client \ python-rest-client \ httplib2__init __ . py“,第715行,在connect raise socket.error,msg错误:[Errno 10061]无法 Build 连接,因为目标机器主动拒绝它