擅长:python、mysql、java
<p>我建议使用awesome<a href="http://docs.python-requests.org/en/latest/index.html" rel="noreferrer">requests</a>库:</p>
<pre><code>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
</code></pre>
<p>JSON响应内容:<a href="http://docs.python-requests.org/en/latest/user/quickstart/#json-response-content" rel="noreferrer">http://docs.python-requests.org/en/latest/user/quickstart/#json-response-content</a></p>