首页 > 代码库 > python利用urllib2读取webservice接口数据

python利用urllib2读取webservice接口数据

import urllib2
import json
response = urllib2.urlopen(‘http://imanage.spreadtrum.com/imanage/home/pm?act=GetAllUser‘)
all_staff = []
result = response.read()
result = json.loads(result, encoding="utf-8")
for k,v in result["data"].iteritems():
all_staff.append(k)
all_staff.sort()
return all_staff

python利用urllib2读取webservice接口数据