Requests中的JSON解码器

>>> import requests
>>> r = requests.get('https://github.com/timeline.json')
>>> r.json()
[{u'repository': {u'open_issues': 0, u'url': 'https://github.com/...
如果JSON解码失败, r.json 就会抛出一个异常。

响应内容为json时使用json()进行解码,如果格式不是json则会解码失败抛出异常

墨者看遍天下皆是丹青,测试看尽万物皆是bug
原文地址:https://www.cnblogs.com/striver-dl/p/14139718.html