Перейти к основному содержимому

3 записи с тегом "json"

Посмотреть все теги

<?php
$fp = fopen('results.json', 'w');
fwrite($fp, json_encode($response, JSON_UNESCAPED_UNICODE));
fclose($fp);

// or file_put_contents('results.json', json_encode($response, JSON_UNESCAPED_UNICODE))

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

# JSON Response Content: https://requests.readthedocs.io/en/master/user/quickstart/#json-response-content