Custom JSONEncoder for requests.post

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'})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)