Vinod Sugur
11/25/2020, 7:26 PMJim Crist-Harif
11/25/2020, 8:14 PMParameter
with a dict-default (which should work fine)? You should never need to touch internal things like JSONCompatible
.
Can you post an example of what you're trying to accomplish, and what errors you're getting?Vinod Sugur
11/26/2020, 1:19 AMChris White
import requests
import json
my_dict = {"x": 42}
<http://requests.post|requests.post>(url, json=my_dict) # post accepts a json kwarg that accepts dictionaries
<http://requests.post|requests.post>(url, data=json.dumps(my_dict)) # or you can convert dict to JSON string using the json library
Vinod Sugur
11/26/2020, 9:11 AM