# -*- 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)