import urllib, sys
import urllib.request
host = 'http://ipquery.market.alicloudapi.com'
path = '/query'
method = 'GET'
appcode = '您的appcode'
querys = 'ip=58.30.0.0'
bodys = {}
url = host + path + '?' + querys
request = urllib.request.Request(url)
request.add_header('Authorization', 'APPCODE ' + appcode)
response = urllib.request.urlopen(request)
content = response.read()
if (content):
print(content)
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询