阿里云市场IP地址查询python调用方法

180it 2019-09-28 PM 428℃ 0条

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)
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

阿里云市场IP地址查询python调用方法