One - One Code All

Blog Content

requests中response.json()方法

Python   2010-04-25 15:18:15

requests中response.json()方法等同于json.loads(response.text)方法。返回的是字典。

import requests
import json
 
response = requests.get("http://httpbin.org/get")
print(type(response.text))
print(response.json())
print(json.loads(response.text))
print(type(response.json())



上一篇:Python通过requests模块发送POST请求
下一篇:python八荣八耻

The minute you think of giving up, think of the reason why you held on so long.