好的,这是我的代码,我想要做的是发布到受密码保护的页面,你可以查看下面的代码,看看我出错的地方
导入请求,sys,socket,json from requests.auth import HTTPDigestAuth,HTTPBasicAuth
params = {' @ Generate':' New'} response = requests.post(' https://TerraceQ.internal.ca/views/Debug_Dump/1',auth = HTTPDigestAuth(' user',' fakepassword'),data = params) print response.status_code
答案 0 :(得分:0)
这有效吗
ip="172.168.99.99"
try:
response = requests.get('https://' + ip + '/views', auth=HTTPDigestAuth('username', 'password'), verify=False)
except urllib3.exceptions.SSLError as e:
sys.exit('test')