Answers for "python send object to json"

2

convert response to json python

#You can use json.loads:

import json
import requests

response = requests.get(...)
json_data = json.loads(response.text)
Posted by: Guest on May-06-2020
4

save a dict to json python

import json

with open('data.json', 'w') as fp:
    json.dump(data, fp)
Posted by: Guest on August-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language