📜  python json 网络请求 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:40.948000             🧑  作者: Mango

代码示例1
import requests

url = 'http://maps.googleapis.com/maps/api/directions/json'

params = dict(
    origin='Chicago,IL',
    destination='Los+Angeles,CA',
    waypoints='Joplin,MO|Oklahoma+City,OK',
    sensor='false'
)

resp = requests.get(url=url, params=params)
data = resp.json() # Check the JSON Response Content documentation below