lomg 发表于 2017-4-30 08:31:43

python 学习之调用web api

import urllib
import json
url = 'http://xxx.xxx.xxx.xxx:8888/xxxx-api/customer/qq/channels'
def get_data():
response = urllib.urlopen(url).read()
json_array = json.loads(response)
channel = {}
for json_map in json_array:
channel] = json_map['name']
return channel;
if __name__ == '__main__':
clist = get_data()
for key in clist.keys():
print("%s %s") % (key, clist)
页: [1]
查看完整版本: python 学习之调用web api