Extracting the answer from the link provided by alecxe, using a custom encoder and the json parameter is not supported. It’s recommended you just construct the post manually.
r = requests.post('http://foo.bar',
data=json.dumps(some_data, cls=CustomJSONEncoder),
headers={'Content-Type': 'application/json'})