阅读回复

response = requests.get("https://api.github.com/events")
text_resp = response.text

JSON 响应 :对于 json 格式的响应,该包提供了一个内置的解码器

response = requests.get('https://api.github.com/events')
json_resp = response.json()

在空响应或不可解析内容的情况下,此方法将引发 ValueError。