You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
auto/test/test_get_ip_hailiangip.py

25 lines
683 B

# -*- coding: utf-8 -*-
import requests
orderId = "O24112815252166905421"
pwd = "Z4cBtneT"
host = "flow.hailiangip.com"
port = "14223"
user = orderId
password = 'pwd=' + pwd + "&pid=-1" + "&cid=-1" + "&uid=" + "&sip=0" + "&nd=0"
targetUrl = "http://api.hailiangip.com:8422/api/myIp"
def httpProxyWithPassRequest(targetUrl):
proxyUrl = "http://" + user + ":" + password + "@" + host + ":" + port
print(proxyUrl)
proxy = {"http": proxyUrl, "https": proxyUrl}
r = requests.get(targetUrl, proxies=proxy)
print("status Code : " + str(r.status_code))
print("response : " + r.text)
return
if __name__ == '__main__':
httpProxyWithPassRequest(targetUrl)