008 python get请求后得到的json字符串解析为pythn字典

import json

import requests

# r = requests.get('https://www.baidu.com')       # 最基本的不带参数的get请求
response = requests.get(url='http://xxx.xxx.xxx.cn:8120/api/Product/GetProductInfoList', \
                  params={'packageNo':'582212031228293'})      # 带参数的get请求

print(type(response.text))
print(json.loads(response.text))  # 将已编码的 JSON 字符串解码为 Python 字典对象
posted @ 2023-05-10 19:12  瑞雪狂飘  阅读(17)  评论(0)    收藏  举报