python send object to json code example
Example 1: save a dict to json python
import json
with open('data.json', 'w') as fp:
json.dump(data, fp)
Example 2: convert response to json python
#You can use json.loads:
import json
import requests
response = requests.get(...)
json_data = json.loads(response.text)